PDA

View Full Version : [Ruby-gems] Undefined method 'ruby_version' for Gem:Module



cybertoast
August 19th, 2008, 04:18 PM
A solution that might be useful to others:
Sometime in the last few weeks I started getting


/usr/bin/gem:14: undefined method `ruby_version' for Gem:Module (NoMethodError)

any time I ran a gem install anything.

The solution was pretty straightforward:


sudo update_rubygems
sudo gem install rubygems_update


Things now work!

qnub
November 30th, 2008, 06:33 PM
sudo update_rubygems
on my system (Ubuntu server 8.10 amd64) say:

sudo: update_rubygems: command not found

hypertall
November 30th, 2010, 05:12 AM
I had the same problem. update_rubygems (or update-rubygems) doesn't work. What I did was follow this: http://stackoverflow.com/questions/1814301/updating-rubygems-on-ubuntu/1818903

sudo apt-get remove rubygems
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz (http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz)
tar xzvf rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo ruby setup.rb
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
sudo gem update --system

It worked for most gems, but still didn't install mongrel and sqlite. I did

sudo apt-get install libsqlite3-dev

and then

gem install mongrel

and that solves it.