1
votes

The project I'm about to work on asks for version 1.0.10 of bundler and version 0.8.7 of rake. My global gemset has slightly newer versions of these gems. I.e., the install instructions for the new project look like this:

rvm gemset use rails3
gem uninstall -x bundler
gem install bundler -v 1.0.10
gem uninstall -x rake
gem install rake -v 0.8.7 # Rake needs to be at 0.8.7

What happens is that when I'm in this new rails3 gemset I can't uninstall the existing gems (and personally I don't want to) because they exist in the global gemset.

So, question: can I somehow hide those two gems that exist in the global gemset?

I can list the gems:

$ gem list
*** LOCAL GEMS ***
addressable (2.2.6)
archive-tar-minitar (0.5.2)
awesome_print (1.0.1)
bundler (1.0.21, 1.0.10)
...
rake (0.9.2.2, 0.8.7)
...

Maybe an ancillary question would be: since I have installed the older versions into the the rails3 gemset, will rvm prefer those because the fact they were specifically installed somehow overrides the version in global, or will rvm take the gems with the highest version number?

1

1 Answers

0
votes

any command except bundle should be prefixed with bundle exec and this will assure proper version of gem is used (using Gemfile)

you can avoid writing always bundle exec by using my gem rubygems-bundler

for running bundle command - rubygems will select latest available version if you do not specify one ex. bundle _1.0.10_ exec rake db:create