使用bundle exec 可以解决这个问题吗?
这是我的 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
要停止使用
bundle exec rake
,您可以运行bundle clean --force
。此命令将更新您的 Gemfile.lock。To stop using
bundle exec rake
you can runbundle clean --force
. This command will update your Gemfile.lock.您可以运行
bundle exec rake console
,这意味着该命令(在本例中为rake console
)将被锁定到 Gemfile 中列出的特定 gem。You can run
bundle exec rake console
which means that the command (in this caserake console
) will be locked to the specific gems listed in your Gemfile.rubygems-bundler 解决了这个问题。运行以下命令:
$ gem install rubygems-bundler
$ $ gem regenerate_binstubs
然后再次尝试您的捆绑包。
rubygems-bundler solves this. Run the following commands:
$ gem install rubygems-bundler
$ $ gem regenerate_binstubs
Then try your bundle again.
您可以检查以确保在 Gemfile 中包含
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
I hope that this helps