35

Background: I'm a designer that works well with HTML, CSS, and JS. But when it comes to setting up my environment is where I fall short.

I recently purchased a home computer. I want to set up Middleman to use in a project. I already installed rvm and all its requirements. I am on ruby-2.0.0-p0, which from what I understand is the latest stable release.

When I attempt to install Middleman, or any other gem for that matter, nothing happens. The cursor just moves to the next line. Screenshot

Some guidance, or troubleshooting steps, would be greatly appreciated!

Thank you,

Ricardo

rvazquez
  • 687
  • 1
  • 8
  • 13
  • For me, this was actually the ipv6 issue described in this Q&A: https://stackoverflow.com/questions/52442766/gem-install-error-timed-out-https-api-rubygems-org –  Jan 06 '20 at 21:09

5 Answers5

44

If gem install is hanging, it's most likely a network, proxy, or firewall issue on your end.

You can investigate by issuing your gem install command in verbose mode with -V. It'll show you what URLs it's communicating with to download the gem, and you can hopefully see what it's doing and where it's hanging:

> gem install -V middleman
HEAD https://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
200 OK
GET https://rubygems.org/latest_specs.4.8.gz
302 Moved Temporarily
GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz
...

You can also check status.rubygems.org where they'll alert you in case the gem/spec servers do have problems (see screenshot below):

RubyGem.org status screenshot

Jeff Ward
  • 16,563
  • 6
  • 48
  • 57
8

Found my problem! I was runnning ruby 1.8.7. I needed to update my .zshrc file to use 1.9.3 as default.

What I did was put this on my .zshrc file:

rvm use 1.9.3 --default
rvazquez
  • 687
  • 1
  • 8
  • 13
3

You seem to be on Mac. Have you Xcode installed?

The cite from MiddleMan official:

Mac OS X comes prepackaged with both Ruby and Rubygems, however, some of the Middleman's dependencies need to be compiled during installation and on OS X that requires Xcode. Xcode can be installed via the Mac App Store. Alternately, if you have a free Apple Developer account, you can just install Command Line Tools for Xcode from their downloads page.

BTW, just out of curiousity, is your connection OK? Try to run ping google.com in the sibling terminal during gem install ….

Aleksei Matiushkin
  • 119,336
  • 10
  • 100
  • 160
  • Thanks for your answer mudasobwa :). I do have XCode installed, as well as Command Line Tools installed. I ran ping google.com and it is showing that I have a connection. Nothing seems to be working unfortunately :( – rvazquez Mar 06 '13 at 22:51
3

I had a similar issue with ruby bundled with MacOS. Installing a new version of Ruby helped.

brew install ruby
echo 'export PATH="/opt/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc
gem install <my gem>

Hope it helps someone. Please note step with ~/.zshrc might need to be adjusted if you are using bash. Brew outputs help commnads, so probably, it wi

Dziki_Jam
  • 170
  • 2
  • 10
1

In case this helps someone, my terminal was hanging on

gem update --system

and changing it to

sudo gem update --system

fixed it.

Tash Pemhiwa
  • 7,590
  • 4
  • 45
  • 49