Friday, September 2, 2011

Bug after updating to ruby 1.9.2 on Arch Linux

If you ever encountered the following error in your ArchLinux box:
$ gem install <your_gem_name_here>
/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>'
You can use these commands to solve the issue:
$ sudo pacman -U /var/cache/pacman/pkg/ruby-1.9.1_p429-1-x86_64.pkg.tar.xz
[or equivalent 1.9.1 version]
$ sudo gem update --system
$ sudo pacman -S ruby

[to return to the new ruby (1.9.2 in my case)]

No comments:

Post a Comment