rake db:migrate is being aborted due to rake version difference [duplicate]

我的梦境 提交于 2019-11-30 13:57:33

You want to use bundle exec:

bundle exec rake db:migrate

Or, if you're using Rails 4 binstubs:

./bin/rake db:migrate

I hit the same error. Running bundle update solved it.

Update: As suggested by TuK bundle update rake is the way to go.

I got this error message while deploying to production with capistrano. To fix it I executed the following on my production server:

gem update rake
RC_02

bundle update rake fixed the issue for me.

Gareth Fuller

I had the same error but running bundle update rake didn't work for me. This answer worked for me. You have to remove your Gemfile.lock:

rm Gemfile.lock

then re-bundle:

bundle install

I got the answer. Why we got this error? For the rake version of our OS is different from the version of our project. When we set the same. Everything gets ok!

The light way is set the same version in our Gemfile. And make sure keep all the project the same rake!

gem 'rake', '10.2.2' #forking error! force the version the same with our OS and all projects!!!

I hope U see what I said and the real reason of this error. Then we will have more resolutions such as "bundle update rake". Thanks!

Dheer

You can run this command

bundle exec rake db:migrate

just install old version by command: gem install rake -v '10.1.0'

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!