문제

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?

도움이 되었습니까?

해결책

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.

다른 팁

Perhaps:

bundle exec rake db:migrate

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.

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top