All attempts to install gems hang

E

Evan Dorn

For a couple weeks, I haven't been able to install any gems on my
MacBook Pro. I got so fed up with it that I eventually even wiped and
reinstalled the drive and OS ... and the problem hasn't gone away.

Here's what happens when I try to install a gem (with verbose debugger
output). Here I've used gemcutter, but this happens with every gem.

Code:
mbp:~ evan$ sudo gem install --verbose --debug gemcutter
Password:
Exception `NameError' at
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:161 -
uninitialized constant Gem::Commands::InstallCommand
Exception `Gem::LoadError' at
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827 - Could not find
RubyGem test-unit (>= 0)

Exception `Gem::LoadError' at
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827 - Could not find
RubyGem sources (> 0.0.1)

GET 302 Found: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 200 OK: http://production.s3.rubygems.org/latest_specs.4.8.gz
GET 302 Found:
http://gems.rubyforge.org/quick/Marshal.4.8/gemcutter-0.3.0.gemspec.rz
GET 200 OK:
http://production.s3.rubygems.org/quick/Marshal.4.8/gemcutter-0.3.0.gemspec.rz
GET 302 Found:
http://gems.rubyforge.org/quick/Marshal.4.8/json_pure-1.2.0.gemspec.rz
GET 200 OK:
http://production.s3.rubygems.org/quick/Marshal.4.8/json_pure-1.2.0.gemspec.rz
Installing gem json_pure-1.2.0
Downloading gem json_pure-1.2.0.gem
GET 302 Found: http://gems.rubyforge.org/gems/json_pure-1.2.0.gem

Here's gem env:

Code:
mbp:~ evan$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2009-12-24 patchlevel 248) [i686-darwin10.0.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-10
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /Users/evan/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/


Here's what I've installed on this computer:
1) Fresh wipe of HD
2) Install Snow Leopard
3) Install Apple Developer tools / xcode
4) Install textmate and Path Finder
5) Install Ruby and Rubygems exactly as per hivelogic:
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/
6) Install mysql as per hivelogic:
http://hivelogic.com/articles/compiling-mysql-on-snow-leopard/

That's it. Attempted to gem install gemcutter and gem install mysql
and got the errors shown above.

The ruby process hangs and shows in top as "sleeping", using 0.3% of
CPU. I've let it sit there for at least 30 minutes with no change.

Any suggestions?
 
R

Roger Pack

/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb

Maybe it's using an "old version" of some of the libraries or what not?
If I were you I would reinstall ruby to some "special" location (like
$HOME/installs), then install rubygems into that instance and use it
from there.
HTH.
-r
 
B

Bret Weinraub

Evan said:
For a couple weeks, I haven't been able to install any gems on my
MacBook Pro. I got so fed up with it that I eventually even wiped and
reinstalled the drive and OS ... and the problem hasn't gone away.

Here's what happens when I try to install a gem (with verbose debugger
output). Here I've used gemcutter, but this happens with every gem.

Code:
mbp:~ evan$ sudo gem install --verbose --debug gemcutter
Password:
Exception `NameError' at
/usr/local/lib/ruby/site_ruby/1.8/rubygems/command_manager.rb:161 -
uninitialized constant Gem::Commands::InstallCommand
Exception `Gem::LoadError' at
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827 - Could not find
RubyGem test-unit (>= 0)

Exception `Gem::LoadError' at
/usr/local/lib/ruby/site_ruby/1.8/rubygems.rb:827 - Could not find
RubyGem sources (> 0.0.1)

GET 302 Found: http://gems.rubyforge.org/latest_specs.4.8.gz
GET 200 OK: http://production.s3.rubygems.org/latest_specs.4.8.gz
GET 302 Found:
http://gems.rubyforge.org/quick/Marshal.4.8/gemcutter-0.3.0.gemspec.rz
GET 200 OK:
http://production.s3.rubygems.org/quick/Marshal.4.8/gemcutter-0.3.0.gemspec.rz
GET 302 Found:
http://gems.rubyforge.org/quick/Marshal.4.8/json_pure-1.2.0.gemspec.rz
GET 200 OK:
http://production.s3.rubygems.org/quick/Marshal.4.8/json_pure-1.2.0.gemspec.rz
Installing gem json_pure-1.2.0
Downloading gem json_pure-1.2.0.gem
GET 302 Found: http://gems.rubyforge.org/gems/json_pure-1.2.0.gem

Here's gem env:

Code:
mbp:~ evan$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2009-12-24 patchlevel 248) [i686-darwin10.0.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-10
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /Users/evan/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/


Here's what I've installed on this computer:
1) Fresh wipe of HD
2) Install Snow Leopard
3) Install Apple Developer tools / xcode
4) Install textmate and Path Finder
5) Install Ruby and Rubygems exactly as per hivelogic:
http://hivelogic.com/articles/compiling-ruby-rubygems-and-rails-on-snow-leopard/
6) Install mysql as per hivelogic:
http://hivelogic.com/articles/compiling-mysql-on-snow-leopard/

That's it. Attempted to gem install gemcutter and gem install mysql
and got the errors shown above.

The ruby process hangs and shows in top as "sleeping", using 0.3% of
CPU. I've let it sit there for at least 30 minutes with no change.

Any suggestions?

Hey me too! I've been through a maze of a 1000 twisty passages; all
alike.

RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [i486-linux]
- INSTALLATION DIRECTORY: /var/lib/gems/1.8
- RUBY EXECUTABLE: /usr/bin/ruby1.8
- EXECUTABLE DIRECTORY: /var/lib/gems/1.8/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-linux
- GEM PATHS:
- /var/lib/gems/1.8
- /root/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- http://gems.rubyforge.org/

gem --debug install ruby-debug
Exception `NameError' at
/usr/lib/ruby/1.8/rubygems/command_manager.rb:161 - uninitialized
constant Gem::Commands::InstallCommand
Exception `Gem::LoadError' at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find RubyGem test-unit (>= 0)

Exception `Gem::LoadError' at /usr/lib/ruby/1.8/rubygems.rb:827 - Could
not find RubyGem sources (> 0.0.1)

Exception `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:243 - No
such file or directory - /root/.gem/specs/gems.rubyforge.org%80
Exception `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:243 - No
such file or directory -
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root/.gem
Exception `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:243 - No
such file or directory -
/root/.gem/specs/gems.rubyforge.org%80/quick/Marshal.4.8
Exception `Errno::ENOENT' at /usr/lib/ruby/1.8/fileutils.rb:243 - No
such file or directory -
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root/.gem
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root/.gem/specs
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root/.gem/specs/gems.rubyforge.org%80
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root/.gem/specs/gems.rubyforge.org%80/quick/Marshal.4.8
Exception `Errno::EEXIST' at /usr/lib/ruby/1.8/fileutils.rb:243 - File
exists - /root/.gem/specs/gems.rubyforge.org%80
Exception `#<Class:0xb650d708>' at /usr/lib/ruby/1.8/timeout.rb:60 -
execution expired
Exception `Timeout::Error' at /usr/lib/ruby/1.8/timeout.rb:74 -
execution expired
Exception `Gem::RemoteFetcher::FetchError' at
/usr/lib/ruby/1.8/rubygems/remote_fetcher.rb:170 - timed out
(http://gems.rubyforge.org/quick/Marshal.4.8/ruby-debug-base-0.10.3.gemspec.rz)
Exception `Gem::RemoteFetcher::FetchError' at
/usr/lib/ruby/1.8/rubygems/spec_fetcher.rb:76 - timed out
(http://gems.rubyforge.org/quick/Marshal.4.8/ruby-debug-base-0.10.3.gemspec.rz)
 
B

Bret Weinraub

I've managed to get some progress (I can actually install a gem) if I
specify --ignore-dependencies.

This and a combination of "wget"-ing the gems and installing them
locally; I actually got the ruby debugger installed.


Somehow I've got a hunch that this is something to do with networking
(this box is NAT-ed); but EVERYTHING else works fine. Sniffle....

-b
 
E

Evan Dorn

Bret said:
I've managed to get some progress (I can actually install a gem) if I
specify --ignore-dependencies.


Interesting, I may have to try that.

I did in fact get gems working just by using Apple's pre-install Ruby
and Gems.

I couldn't do that with 10.5, because the pre-installed Ruby was 1.8.6
rather than 1.8.7, and I had compatibility problems with some of my
plugins under 1.8.6. But so far it's working for Snow Leopard.

It's frustrating, though, that building my own Ruby would cause such a
problem. It works just fine on on my desktop (Mac Pro) - it's only on
the laptop where it's been a problem.
 
B

Bret Weinraub

Evan said:
Interesting, I may have to try that.

I did in fact get gems working just by using Apple's pre-install Ruby
and Gems.

I couldn't do that with 10.5, because the pre-installed Ruby was 1.8.6
rather than 1.8.7, and I had compatibility problems with some of my
plugins under 1.8.6. But so far it's working for Snow Leopard.

It's frustrating, though, that building my own Ruby would cause such a
problem. It works just fine on on my desktop (Mac Pro) - it's only on
the laptop where it's been a problem.

Although I never actually was able to put my finger on something that
fully did not work, I was able to resolve my problem via voodoo rites.

Basically this Ubuntu instance was running in Virtual Box on a Win7
machine. Now virtual box (like a lot of virtualization software)
generally defaults to NAT (network address translation) for network
connectivity.

Switching to "Bridged" on the interface pretty much cleared up the
problem; even though heavy network users like "apt-get" functioned just
fine. Whatever flakiness exists in the network only manifested itself
with "gem install". Bridged gives you a real address on your network,
instead of your packets being rewritten by the "host" machine.

I've seen of this with some VPN software; just will not function over a
NAT-ed interface. Switch to bridged, and its all good.

Probably should be a bug report for rubygems; it won't run off a NAT-ed
VM.
 
M

Magnus Hjelmblom

Bret said:
Basically this Ubuntu instance was running in Virtual Box on a Win7
machine. Now virtual box (like a lot of virtualization software)
generally defaults to NAT (network address translation) for network
connectivity.

Switching to "Bridged" on the interface pretty much cleared up the
problem; even though heavy network users like "apt-get" functioned just
fine. Whatever flakiness exists in the network only manifested itself
with "gem install". Bridged gives you a real address on your network,
instead of your packets being rewritten by the "host" machine.

I've seen of this with some VPN software; just will not function over a
NAT-ed interface. Switch to bridged, and its all good.

Probably should be a bug report for rubygems; it won't run off a NAT-ed
VM.

So, for me (and my students) who can't switch to bridged due to the
university's security policies, there basically is no solution? Wow.
This is killing me, new troubles every time I give this course. I
seriously must reconsider using Rails.

I suppose I could use aptitude to get an older Rails version, and do a
'gem freeze' for the application instead of upgrading Rails on the
server?
 
B

Bret Weinraub

Magnus said:
So, for me (and my students) who can't switch to bridged due to the
university's security policies, there basically is no solution? Wow.
This is killing me, new troubles every time I give this course. I
seriously must reconsider using Rails.

I suppose I could use aptitude to get an older Rails version, and do a
'gem freeze' for the application instead of upgrading Rails on the
server?

I blame myself for not filing a bug on rubyforge for this:

http://rubyforge.org/tracker/?atid=575&group_id=126&func=browse

Maybe you can pick up the torch? I have some more suggestions on this
problem that I will post tomorrow.

-bret
 
B

Bret Weinraub

Magnus said:
So, for me (and my students) who can't switch to bridged due to the
university's security policies, there basically is no solution? Wow.
This is killing me, new troubles every time I give this course. I
seriously must reconsider using Rails.

I suppose I could use aptitude to get an older Rails version, and do a
'gem freeze' for the application instead of upgrading Rails on the
server?

Here are some alternative options:

- yes use gem:freeze should allow you to get the app working somewhere
else, and then you can just pull the app onto the NAT-ed box.
- you can also install the gems from the source. It really isn't that
bad to do this, and you probably only need half a dozen gems for rails.
- you can push the whole thing into the cloud; I for one like linode :
www.linode.com

For what its worth gem isn't the ONLY piece of software that won't run
on certain NAT-ed machines; I've experienced a similar problem with some
VPN software.

Anyways I opened a bug for this

http://rubyforge.org/tracker/index.php?func=detail&aid=27946&group_id=126&atid=575

and if you could update the bug description (or post and I will attach)
your "gem env" and the debugging output of your "gem update" command.
I'm sure that's more than a few people who've been frustrated by this.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,529
Members
45,001
Latest member
Kendra00E1

Latest Threads

Top