newbie: error message when 'rake -T'

為{幸葍}努か 提交于 2020-01-01 09:10:11

问题


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.

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?

------------------------------ more ---------------------------

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??


回答1:


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

Alternatively, update your Gemfile.




回答2:


This is because your rake tool does not match the version written in the Gemfile.

You first need to run this command, to ensure rake 0.9.2 get installed:

bundle install

Then, you can run rake 0.9.2 with the following command:

bundle exec rake -T

The bundle thing is a nice tool to help you manage the dependency of your application. You can get more info from here.



来源:https://stackoverflow.com/questions/8050276/newbie-error-message-when-rake-t

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