You are not logged in.
Hi all,
I've been having trouble getting using the gem tool included with the version of ruby from the extra repository. Whenever I try to run gem I run into an error:
$ gem
/usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:62:in `installed_spec_directories': undefined method `path' for Gem:Module (NoMethodError)
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:52:in `from_installed_gems'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:914:in `source_index'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:83:in `init_gemspecs'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_path_searcher.rb:13:in `initialize'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:873:in `new'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:873:in `searcher'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:495:in `find_files'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems.rb:1034:in `load_plugins'
from /usr/lib/ruby/site_ruby/1.9.1/rubygems/gem_runner.rb:84:in `<top (required)>'
from <internal:lib/rubygems/custom_require>:29:in `require'
from <internal:lib/rubygems/custom_require>:29:in `require'
from /usr/bin/gem:9:in `<main>'A similar issue was reported in an earlier thread (https://bbs.archlinux.org/viewtopic.php?id=104198), but the solutions suggested there have not been able to help me.
Any ideas?
Thanks,
Keith
Last edited by hughitt1 (2011-02-17 15:50:24)
Keith
dotfiles
Offline
Still no luck. I noticed that even though ruby 1.9.2 is installed (ruby 1.9.2p136 (2010-12-25 revision 30365)), it seems like all of the files and directories are stored as "1.9.1", e.g.:
pacman -Ql ruby
ruby /usr/
ruby /usr/bin/
ruby /usr/bin/erb
ruby /usr/bin/gem
ruby /usr/bin/irb
ruby /usr/bin/rake
ruby /usr/bin/rdoc
ruby /usr/bin/ri
ruby /usr/bin/ruby
ruby /usr/bin/testrb
ruby /usr/include/
ruby /usr/include/ruby-1.9.1/
ruby /usr/include/ruby-1.9.1/i686-linux/
ruby /usr/include/ruby-1.9.1/i686-linux/ruby/
ruby /usr/include/ruby-1.9.1/i686-linux/ruby/config.h
ruby /usr/include/ruby-1.9.1/ruby.h
ruby /usr/include/ruby-1.9.1/ruby/
...Next thing to try may be to manually install gem.
Keith
dotfiles
Offline
The library paths will remain as 1.9.1 as it indicates the compatibility level (see the 1.9.2 Release Notes).
Please try the following:
Rename /usr/lib/ruby/site_ruby/ to site_ruby.bak/
Run the following commands:
gem install rubygems-update
update_rubygemsYou should be upgraded to Rubygems 1.5.2 which doesn't have these issues.
If you get an error during the update please try the following instead:
ruby --disable-gems -S update_rubygemsOffline
Hi Awkwood,
That did the trick. Thanks! I actually ended up uninstalling ruby completely (including manually removing /usr/lib/ruby), and afterwards I had a working but outdated version of Rubygems. I then ran "gem update --system" and got:
Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.5.2
Updating RubyGems to 1.5.2
Installing RubyGems 1.5.2
RubyGems 1.5.2 installed
=== 1.5.2 / 2011-02-10
NOTE: RubyGems 1.5.0 and 1.5.1 have a broken <tt>gem update --system</tt>.
To upgrade you'll need to use the manual upgrade recipe. Using sudo/su as
appropriate:
$ gem install rubygems-update
$ update_rubygems
Bug Fixes:
* Fixed <tt>gem update --system</tt>. RubyGems can now update itself again.Which is exactly as you suggested. I think what must have happened before is that I ran gem update but then completely missed this part.
Thanks for your help!
Best,
Keith
Keith
dotfiles
Offline