On a rails project that I know to have been working as recently as Friday I am suddenly getting this message when I try to perform any rake tasks:
You have already activated launchy 0.3.7, but your Gemfile requires launchy 0.4.0. Consider using bundle exec.
Thinking that was odd I checked out my Gemfile, I am not calling for launchy anywhere (though it is appearing in my Gemfile.lock).
When running bundle show launchy it is informing me that I am using:
Ruby192/lib/ruby/gems/1.9.1/gems/launchy-0.4.0
I’ve tried running bundle update rake, re-running bundle install, and using both rake db:create and bundle exec rake db:create. What changed?
Looks like you’re not using RVM. I would highly recommend installing it.
Assuming that you have an RVM and, for instance, Ruby 1.9.2-p180 installed, I’d do the following:
create a my_project gemset:
rvm gemset create my_projectinside the project’s folder create an
.rvmrcfile, with the following line in it:rvm use 1.9.2-p180@my_projectcd .inside the project dir and accept all the prompts;install
bundlergem:gem install bundlerbundlecommand inside the project root.That should do the trick. In my example I insist using RVM, as it will isolate all your project gems from the system ones. Once you run
bundlecommand, Bundler will manage the dependencies for you, so there’s obviously no need to explicitly specifylaunchygem in your Gemfile.