新手:'rake -T' 时的错误消息 [英] newbie: error message when 'rake -T'

查看:32
本文介绍了新手:'rake -T' 时的错误消息的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的项目使用 Ruby 企业版.当我通过运行命令 rake -T 检查所有 rake 任务时,我收到以下错误消息:

I am using Ruby Enterprise Edition for my project. When I check all my rake task by run the command rake -T , I got the following error message:

You have already activated rake 0.9.2.2, but your Gemfile requires rake 0.9.2. Using bundle exec may solve this.

错误消息暗示我可以使用 bundle exec 来解决问题,但我不确定如何解决?那么,如何摆脱这个错误信息?

The error message implies that I can use bundle exec to solve the problem, but I am not sure how? So, how to get rid of this error message?

------------------------------ 更多 ---------------------------

我更喜欢更新我的 Gemfile 而不是运行 bundle exec rake -T.但是当我打开我的项目 Gemfile 时,我没有在我的 Gemfile 中看到 rake 0.9.2,为什么错误消息抱怨我有它?我定义 rake 0.9.2 的地方可能在哪里??

I prefer to update my Gemfile instead of run bundle exec rake -T. But when I open my project Gemfile, I did not see rake 0.9.2 in my Gemfile, why the error message complains that I have it? Where could be the place I defined rake 0.9.2??

推荐答案

Run bundle exec rake -T,这可以确保运行的是 Gemfile 中指定的 rake 版本,而不是其他版本.

Run bundle exec rake -T, this ensures that the version of rake that is specified in your Gemfile is running, not another version.

或者,更新您的 Gemfile.

Alternatively, update your Gemfile.

这篇关于新手:'rake -T' 时的错误消息的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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