While installing RubyGems 1.7.2 it installed 1.3.5

2019-08-07 04:20发布

问题:

I just went through the install of Ruby 1.7.2 and for some reason I ended up with version 1.3.5

So now when I do this command:

gem --version
1.3.5

My thinking is that I have to purge the 1.3.5 version and install the 1.7.2 fresh correct?

The funny thing is that I do have 1.7.2 on my file system at

/usr/local/rubygems-1.7.2

How do I un-confuse the system into seeing the right version?

The whole issue is stemming when I try to install rails by doing this:

gem install rails
ERROR:  Error installing rails:
    bundler requires RubyGems version >= 1.3.6

回答1:

Try following these steps:

  • Remove version 1.7.2
  • sudo apt-get --purge remove rubygems to remove the 1.3 version
  • Now re-install 1.7.2 using the downloaded package you had before


回答2:

Try running which gem to see where the gem is referencing. You might need to re-link gem to the new one.

Or you can try to upgrade using gem update --system