使用较旧版本的Rake [英] Use older version of Rake
问题描述
我的Rake版本为0.9.1,但我需要在项目中使用0.8.7,并且可以确定我同时安装了这两个版本,但默认情况下始终使用0.9.1.有没有办法指定要使用哪个版本的Rake?
I have Rake version 0.9.1 but I need to use 0.8.7 for a project, and I'm fairly certain I have both version installed but it always uses 0.9.1 by default. Is there a way to specify which version of Rake to use?
我正在尝试运行此命令:rake db:drop db:create db:migrate db:seed 我得到这个错误: 您已经激活了rake 0.9.1,但是您的Gemfile需要rake 0.8.7.考虑使用bundle exec.
I'm trying to run this: rake db:drop db:create db:migrate db:seed and I get this error: You have already activated rake 0.9.1, but your Gemfile requires rake 0.8.7. Consider using bundle exec.
推荐答案
您可以在Gemfile中指定要使用的Rake版本:
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.
有关bundle exec
的更多信息: http://gembundler.com/man/bundle -exec.1.html
这篇关于使用较旧版本的Rake的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!