使用捆绑器管理开发/生产中的不同 Rails 2.3.x 版本
我正在尝试使用bunder网站中的指南将Bundler配置为与不同的Rails 2.3.x版本一起使用,因此我可以在将版本用于生产之前在开发环境中对其进行测试。我有以下 Gemfile:
# some common gems
group :development do
# installed on dev machine
gem "rails", "2.3.11"
#... some more dev gems
end
group :production do
gem "rails", "2.3.8", :path => 'vendor/rails'
end
当我尝试在开发模式下运行服务器时,我收到捆绑器错误您不能在不同版本要求的情况下两次指定相同的 gem。您指定了:rails (= 2.3.11) 和rails (= 2.3.8) (Bundler::DslError)
。我缺少什么?我认为 Bundler 的目标就是帮助我做到这一点。谢谢。
I'm trying to configure Bundler to work with different Rails 2.3.x versions using the guide in the bunder website, so I could test a version in dev environment before its used in production. I have the following Gemfile:
# some common gems
group :development do
# installed on dev machine
gem "rails", "2.3.11"
#... some more dev gems
end
group :production do
gem "rails", "2.3.8", :path => 'vendor/rails'
end
When I try to run the server in dev mode, I get a bundler error You cannot specify the same gem twice with different version requirements. You specified: rails (= 2.3.11) and rails (= 2.3.8) (Bundler::DslError)
. What am I missing? I thought the goal of Bundler was to help me do just that. thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
http://gembundler.com/groups.html
我认为您只需要指定您所在的组安装。我认为默认情况下它只会遍历所有组,因此只需指定您不需要的内容即可。
来自同一页面:
需要特定组中的 gem,请注意命名组之外的 gem 位于 :default 组
中 需要默认 gem,以及与当前 Rails 环境命名相同的组中的 gem
在这种情况下,您需要第二个。
http://gembundler.com/groups.html
I think you just need to specify which group you're installing. I think by default it just goes through all the groups, so just specify what you don't need.
from the same page:
Require the gems in particular groups, noting that gems outside of a named group are in the :default group
Require the default gems, plus the gems in a group named the same as the current Rails environment
In this case, you need the second one.