user1385440
user1385440

Reputation: 33

Why does RVM point to the wrong rubygems?

I switched to RVM a few months ago, and don't recall installing any new gems until yesterday. When I require the new gem, I get:

/home/rob/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require': no such file to load -- mspire/peak_list (LoadError)

Even though:

gem install mspire

worked just fine.

I am guessing that the issue lies in the fact that Ruby is looking for the gem in 1.9.1's rubygems instead of 1.9.2 (the version I am using). I set the version with rvm use. Is there something I am omitting?

Upvotes: 1

Views: 748

Answers (1)

Holger Just
Holger Just

Reputation: 55833

Ruby >= 1.9.1 always saves its libraries in a 1.9.1. directory. This denotes that all those Ruby versions adhere to 1.9.1 compatibility. It does not denote the actual Ruby version used.

Your gems should be saved in /home/rob/.rvm/gems/ruby-1.9.2-p290/gems. There should be a directory named after the gem and the exact version in there. The paths set by RVM can be checked with rvm info. The GEM_PATH should look like /home/rob/.rvm/gems/ruby-1.9.2-p290:/home/rob/.rvm/gems/ruby-1.9.2-p290@global.

Make sure you install the gem with the exact same Ruby and gemset you are using it with. If you change the Ruby or the gemset, you have to re-install the gem.

Upvotes: 2

Related Questions