问题
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.

Some guidance, or troubleshooting steps, would be greatly appreciated!
Thank you,
Ricardo
回答1:
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):
回答2:
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
回答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 …
.
来源:https://stackoverflow.com/questions/15239859/gem-install-hangs-indefinitely