I’m running Rails 3.2.1 & Ruby 1.9.2-p290 within an RVM environment
Within my dev folder, I have a number of different Rails apps, all running the above, but I haven’t created separate gemsets
I created a new app with its own gemfile, ran bundle install etc and all was ok till I went back the the main app I was working on originally
When I now do a rake routes I get the error
rake aborted!
You have already activated rake 10.0.3, but your Gemfile requires rake 10.0.2. Using bundle exec may solve this.
I think I know how to get back on track, but here’s what I don’t understand:
When I look at the .rvm/gems/ruby-1.9.2-p290/gems folder, I can see a folder for each of the gems for rake-0.8.7, rake-0.9.2.2, rake-10.0.2, rake-10.0.3
So I have a version of rake 10.0.2 installed, my main app gemfile.lock calls for rake(10.0.2) and when I run bundle exec rake routes it does actually work (presumeably running 10.0.2?), but when I run a straight rake routes, Rails seems to want to run a different version of Rake that its not being asked to.
So my question is how do I know which version of an installed Gem is actually being run, given that calling for a particular version of an installed Gem seems not to do as you’d expect?
(separately, I guess that if I’m developing different apps within the same RVM space, I should probably be creating separate gemsets for each app?)
this problem is fixed in rubygems 2.0 – Gemfile can be respected for loading any executable gem.
as for your problem RVM comes with my gem installed
rubygems-bundlerand it should automatically resolve dependencies if possible – it would fallback to your problem if proper version is not installed, there is a ticket to change the situation to raise an exception in that case – https://github.com/mpapis/rubygems-bundler/issues/37basically – make sure you run
bundle installbefore doing anything in the project, andrubygems-bundlerwill ensure proper versions of gems are ran.