0

I try to run rake routes on an older Rails application, then I got this:

Gem::LoadError: You have already activated rake 11.1.2, but your Gemfile requires rake 10.4.2. Prepending `bundle exec` to your command may solve this.

So I tried bundle exec, it works.

But how can I change my Gemfile so that I don't have to bundle exec, rake 10.4.2 is not explicitly in my Gemfile.

Thanks.

Uzbekjon
  • 11,655
  • 3
  • 37
  • 54
totally
  • 135
  • 8
  • Possible duplicate of [Already activated rake version different than what Gemfile requires prevents rake commands](http://stackoverflow.com/questions/23287357/already-activated-rake-version-different-than-what-gemfile-requires-prevents-rak) – Uzbekjon May 26 '16 at 17:48

1 Answers1

0

Your current gemset has rake version 11.1.2, but your Gemfile.lock requires to use older version (namely 10.4.2).

If updating your project gems versions won't break your project, you can delete Gemfile.lock file and then run bundle install to create a new one. Then, the "problem" should be fixed.

Uzbekjon
  • 11,655
  • 3
  • 37
  • 54
  • yes @Uzbekjon is right, try deleting Gemfile.lock if your app is currently under development. Otherwise uninstall `rake 11.1.2` and try `bundle` once more. – Tenzin Chemi May 26 '16 at 17:59