gpt4 book ai didi

ruby-on-rails - 为什么我的环境需要我运行 bundle exec?

转载 作者:行者123 更新时间:2023-12-03 20:49:21 31 4
gpt4 key购买 nike

每当我运行 rake 命令(即 rake routes )时,我都会收到此错误:

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 rake routes有用。

我希望能够简单地 rake routes无需运行 bundle exec rake routes .

我查看了其他有类似错误的问题,并尝试了各种解决方案(如运行 bundle update )但无济于事。

另外,在我的 gemfile 中我指定了 gem 'rake', '0.9.2'
有什么建议?

最佳答案

尝试执行:

gem list

您可能会看到为 rake 安装了几个版本。顺便说一句, bundle exec正道在 Rails 应用程序的上下文中执行代码。因此,您可以使用别名来减少输入。

关于ruby-on-rails - 为什么我的环境需要我运行 bundle exec?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8106095/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com