Use older version of Rake

做~自己de王妃 提交于 2019-11-29 01:45:46

You can specify the version of Rake to use, in your Gemfile:

gem 'rake', '0.8.7'

Though the "error" message you are getting says it all... you need to run:

bundle exec rake ...

... in order to use the right rake to run your rake tasks.

More info on bundle exec: http://gembundler.com/man/bundle-exec.1.html

gem search (or list) rake, should tell you which versions are installed.

You can invoke rake with a specific version number bracketed with underscores.

$rake _0.7.3_

This is a standard feature of gem packaged binaries.

Luke

Try executing gem uninstall rake then just pick the version you want to uninstall.

It happens because you are using rake from the system. (latest version by default) The solution is use follow command:

bundle exec rake db:migrate

Also, you can create alias. Because this command is too big and difficult to write.

echo "alias be='bundle exec'" >> ~/.bash_profile
source ~/.bash_profile

Then you can use follow short command:

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