So, the migration to Snow Leopard has gone well, except that it’s
totally bollixed up my ruby/rails development environment.
It looks like Snow Leopard shipped with gem version 1.2.0 is this
right?
$ which gem
/usr/bin/gem
$ gem --version
1.2.0
Okay, so I guess I need to update
$ sudo gem update --system
Password:
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.2.0
ERROR: While executing gem … (NameError)
undefined local variable or method `remote_gemspecs’ for
#<Gem::Commands::UpdateCommand:0x1018e16b8
And some of the (old) stuff I found via google says to do it again,
but I get exactly the same thing, so then plan B is suggested
$ sudo gem install rubygems-update
Successfully installed rubygems-update-1.2.0
1 gem installed
$ update_rubygems
Installing RubyGems 1.2.0
mkdir -p /Library/Ruby/Site/1.8
mkdir -p /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin
install -c -m 0644 rbconfig/datadir.rb
/Library/Ruby/Site/1.8/rbconfig/datadir.rb
… # Lots of install lines snipped
install -c -m 0644 ubygems.rb /Library/Ruby/Site/1.8/ubygems.rb
cp gem /var/folders/DV/DVi3x+y8HiSSTCLkEYVBpE+++TI/-Tmp-/gem
install -c -m 0755
/var/folders/DV/DVi3x+y8HiSSTCLkEYVBpE+++TI/-Tmp-/gem
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
rm /var/folders/DV/DVi3x+y8HiSSTCLkEYVBpE+++TI/-Tmp-/gem
rm -f /source_cache
Removing old RubyGems RDoc and ri
Installing rubygems-1.2.0 ri into /doc/rubygems-1.2.0/ri
Installing rubygems-1.2.0 rdoc into /doc/rubygems-1.2.0/rdoc
= Announce: RubyGems Release 1.2.0
Release 1.2.0 adds new features and fixes some bugs.
[snip]
If you have a recent version of RubyGems (0.8.5 or later), then all
you need to do is:
$ gem update --system (you might need to be admin/root)
(Note: You may have to run the command twice if you have any previosly
installed rubygems-update gems).
If you have an older version of RubyGems installed, then you can still
do it in two steps:
$ gem install rubygems-update (again, might need to be admin/root)
$ update_rubygems (… here too)
[ Sounds like what I did]
If gem
was installed by a previous RubyGems installation, you may need
to remove it by hand.
$ gem --version
1.2.0
WTF???
Okay so where is the gem binary?
$ which gem
/usr/bin/gem
$ ls -al /usr/bin/gem
lrwxr-xr-x 1 root wheel 71 Aug 29 14:15 /usr/bin/gem →
…/…/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/gem
So, is there a newer rubygems-update?
$ gem list -b rubygems-update
*** LOCAL GEMS ***
rubygems-update (1.2.0)
*** REMOTE GEMS ***
rubygems-update (1.3.5)
\e]0;rick➜ ~ $ gem sources
*** CURRENT SOURCES ***
http://gems.rubyforge.org/
http://gems.github.com
So let’s try installing that:
$ gem update rubygems-update
Updating installed gems
Updating rubygems-update
Successfully installed rubygems-update-1.2.0
ERROR: While executing gem … (NameError)
undefined local variable or method `remote_gemspecs’ for
#Gem::Commands::UpdateCommand:0x1018e1690
Okay lets’s try installing the specific version:
$ gem install --remote --version 1.3.5 rubygems-update
Successfully installed rubygems-update-1.2.0
1 gem installed
And the version gets ignored.
Any ideas about how to get out of this loop???
–
Rick DeNatale
Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale