3

Gemfile

gem 'rails', '4.0.0'
ruby '2.0.0'

I am using rails 4 but some how, rake 10.1.1 is installed. So, whenever I fire a command like

rake db:migrate

It is giving following error:

rake aborted!
You have already activated rake 10.1.1, but your Gemfile requires rake 10.1.0. Using     bundle exec may solve this.

I don't want to write bundle exec each time I fire rails commands.

So, any nice solution for this??

Thanks for your interest

3 Answers 3

27

Actually,

gem uninstall rake -v 10.1.1

and then

bundle install

Works for me. Thanks Ju Liu.

0
3

You could use

gem uninstall rake

and remove the newer version of the gem.


Or add the current version as a binstub with

bundle exec rake rails:update:bin
bundle binstubs rake

After that, you can use

bin/rake db:migrate
-1

Simply run:

bundle update

Done!

1
  • but doing that, it will update all gems in gemfile, which is not expected and can break application.
    – przbadu
    Aug 24, 2020 at 7:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.