使用旧版本的 Rake [英] Use older version of Rake

查看:27
本文介绍了使用旧版本的 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 ...

...为了使用正确的 rake 来运行您的 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆