如何让 mongrel 与捆绑器一起工作?
过渡到具有现有生产设置的捆绑器。天真地使用 gemfile 和设置,例如:
gem "rails", "2.3.8"
gem "mongrel", git: "http://github.com/dynamix/mongrel.git"
bundle install --path /mnt/app/shared/bundle
从
bundle exec mongrel_rails start --environment=production ...
结果
/mnt/app/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:166:in `require':
no such file to load -- /mnt/services/shared/bundle/ruby/1.9.1/gems/mongrel-1.2.0.beta.1/lib/mongrel/init.rb (MissingSourceFile)
开始做什么?
Transitioning to bundler with an existing production setup. Naively with a gemfile and setup like:
gem "rails", "2.3.8"
gem "mongrel", git: "http://github.com/dynamix/mongrel.git"
bundle install --path /mnt/app/shared/bundle
Starting with
bundle exec mongrel_rails start --environment=production ...
results in
/mnt/app/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:166:in `require':
no such file to load -- /mnt/services/shared/bundle/ruby/1.9.1/gems/mongrel-1.2.0.beta.1/lib/mongrel/init.rb (MissingSourceFile)
What to do?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
回答我自己的问题,因为我在网络上的其他地方找不到针对这种情况的正确解决方案:
问题似乎是
bundler
和mongrel
使用的交互gem_plugin
的。是的,这些可能需要生命支持,但不幸的是很多人的生产配置仍然依赖于它们。似乎从
git
源安装mongrel --pre
后,它会在bundle/ruby/1.9.1/gems/mongrel_
而不是中查找bundle/ruby/1.9.1/bundler/gems/mongrel_
这是bundler
存储从git
克隆的 gem 的地方。因此,适用于我们的配置的解决方案就是对它们进行符号链接:
这显然是捆绑器可以自动完成的简单事情。异常的完整跟踪是:
To answer my own, since I couldn't find a correct solution elsewhere on the web for this scenario:
The problem seems to be an interaction of
bundler
andmongrel
's use of thegem_plugin
. Yes, these may be on life support but unfortunately lots of people's production configs still depend on them.Seems that with
mongrel --pre
installed from thegit
source, it's looking inbundle/ruby/1.9.1/gems/mongrel_
instead ofbundle/ruby/1.9.1/bundler/gems/mongrel_
which is wherebundler
is stashing the gem cloned fromgit
.So the solution that worked for our config is to just symlink them:
This is clearly something simple that bundler could do automatically. Full trace of the exception was: