不能激活[]的rake(= 0.9.2.2,运行时),已激活rake-10.0.2 for [] [duplicate]

时间:2022-01-29 23:31:42

This question already has an answer here:

这个问题在这里已有答案:

I'm trying to run a simple rake task. When I do, I get the following error:

我正在尝试运行一个简单的rake任务。当我这样做时,我收到以下错误:

can't activate rake (= 0.9.2.2, runtime) for [], already activated rake-10.0.2 for []

无法激活[]的rake(= 0.9.2.2,运行时),已激活rake-10.0.2 for []

I run the gem list command, and it lists rake as having 10.0.3, 0.9.2.2, and 0.8.7.

我运行gem list命令,它将rake列为10.0.3,0.9.2.2和0.8.7。

So, I type gem uninstall rake -v 10.0.3. According to the prompt, the uninstall was successful - but version 10.0.3 is still there when I do a gem list - and I still get the exact same problem when I try to run any rake task.

所以,我输入gem uninstall rake -v 10.0.3。根据提示,卸载是成功的 - 但是当我执行gem列表时,版本10.0.3仍然存在 - 当我尝试运行任何rake任务时,我仍然得到完全相同的问题。

Any suggestions?

Thanks in advance, Tim

蒂姆,提前谢谢

2 个解决方案

#1


9  

You can either :

你可以:

  • run bundle exec rake to use the version of rake listed on your Gemfile.lock if you don't want to update it
  • 如果您不想更新它,请运行bundle exec rake以使用Gemfile.lock上列出的rake版本

  • Update the version of rake used in your Gemfile.lock by running bundle update rake and then you will be able to use the command rake again !
  • 通过运行bundle update rake更新Gemfile.lock中使用的rake版本,然后您就可以再次使用rake命令了!

#2


14  

You probably have the older version of rake listed in your Gemfile.lock. Try to run bundle update rake, which should update everything rake-related and change your Gemfile.lock as well.

您可能在Gemfile.lock中列出了旧版本的rake。尝试运行bundle update rake,它应该更新与rake相关的所有内容并更改你的Gemfile.lock。

#1


9  

You can either :

你可以:

  • run bundle exec rake to use the version of rake listed on your Gemfile.lock if you don't want to update it
  • 如果您不想更新它,请运行bundle exec rake以使用Gemfile.lock上列出的rake版本

  • Update the version of rake used in your Gemfile.lock by running bundle update rake and then you will be able to use the command rake again !
  • 通过运行bundle update rake更新Gemfile.lock中使用的rake版本,然后您就可以再次使用rake命令了!

#2


14  

You probably have the older version of rake listed in your Gemfile.lock. Try to run bundle update rake, which should update everything rake-related and change your Gemfile.lock as well.

您可能在Gemfile.lock中列出了旧版本的rake。尝试运行bundle update rake,它应该更新与rake相关的所有内容并更改你的Gemfile.lock。