使用bundle exec 可以解决这个问题吗?

发布于 2024-12-26 06:53:09 字数 479 浏览 4 评论 0原文

这是我的 Gemfile

source :rubygems

gem 'rake', '0.9.2.2'
gem 'sinatra'
gem 'activerecord', '3.0.9'
gem 'pg', '~> 0.12.2'
gem 'logger'
gem 'nokogiri'

group :development, :test do
  gem 'rack-test'
  gem 'ruby-debug19'
  gem 'sqlite3'
end

我运行了在其他项目中工作的 rake console,现在我收到此消息:

您已经激活了 activesupport 3.1.3,但是您的 Gemfile 需要主动支持3.0.9。使用bundle exec 可以解决这个问题。

如何使用`bundle exec 来解决这个问题?这是什么意思?

Here is my Gemfile

source :rubygems

gem 'rake', '0.9.2.2'
gem 'sinatra'
gem 'activerecord', '3.0.9'
gem 'pg', '~> 0.12.2'
gem 'logger'
gem 'nokogiri'

group :development, :test do
  gem 'rack-test'
  gem 'ruby-debug19'
  gem 'sqlite3'
end

I run rake console which works in other projects and now I get this message:

You have already activated activesupport 3.1.3, but your Gemfile requires activesupport 3.0.9. Using bundle exec may solve this.

How do I use `bundle exec to solve this? What does it mean?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

是你 2025-01-02 06:53:09

要停止使用 bundle exec rake,您可以运行 bundle clean --force。此命令将更新您的 Gemfile.lock。

To stop using bundle exec rake you can run bundle clean --force. This command will update your Gemfile.lock.

拍不死你 2025-01-02 06:53:09

您可以运行bundle exec rake console,这意味着该命令(在本例中为rake console)将被锁定到 Gemfile 中列出的特定 gem。

You can run bundle exec rake console which means that the command (in this case rake console) will be locked to the specific gems listed in your Gemfile.

穿透光 2025-01-02 06:53:09

rubygems-bundler 解决了这个问题。运行以下命令:

$ gem install ruby​​gems-bundler

$ $ gem regenerate_binstubs

然后再次尝试您的捆绑包。

rubygems-bundler solves this. Run the following commands:

$ gem install rubygems-bundler

$ $ gem regenerate_binstubs

Then try your bundle again.

燃情 2025-01-02 06:53:09

您可以检查以确保在 Gemfile 中包含 rake。如果不是,请添加它,并指定版本“您已经激活”。

或者你可以在本地更新它,就像

bundle update rake

我希望这有帮助

You can check to make sure that you include rake in your Gemfile. If it's not, add it, and specify the version "you already activated".

or you can just update it on your local like

bundle update rake

I hope that this helps

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文