6

When I do rake db:migrate, I get the following error:

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

How can solve this?

4 Answers 4

3

This error is due to the fact that some applications may specify different versions of gems than the ones you have installed.

Try using bundle exec rake db:migrate.

Using bundle exec guarantees that the program is run with the environment specified in the gemfile.

Sign up to request clarification or add additional context in comments.

Comments

2

Perhaps:

bundle exec rake db:migrate

Comments

0

There might be other gems in the Gemfile which are dependent on rake 10.2.2, while you are trying to install rake 10.1.0 via your gemfile or explicitly mentioned it. A look into your Gemfile will help.

In case you have specific environment, you may want to run

bundle exec rake db:migrate 

to make sure you are running it appropriately.

Comments

0

As per another answer given on this topic, you can also try deleting the Gemfile.lock file and re-running bundle install to regenerate the Gem dependencies.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.