Reputation:
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?
Upvotes: 6
Views: 414
Reputation: 2559
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.
Upvotes: 0
Reputation: 1076
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.
Upvotes: 3
Reputation: 1020
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.
Upvotes: 0