1

使用现有的生产设置过渡到捆绑器。天真地使用 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)

该怎么办?

4

1 回答 1

1

回答我自己的问题,因为我在网络上的其他地方找不到针对这种情况的正确解决方案:

bundler问题似乎mongrelgem_plugin. 是的,这些可能是生命支持,但不幸的是,很多人的生产配置仍然依赖于它们。

似乎mongrel --pregit源代码安装,它正在寻找而bundle/ruby/1.9.1/gems/mongrel_不是从.bundle/ruby/1.9.1/bundler/gems/mongrel_bundlergit

因此,适用于我们配置的解决方案是对它们进行符号链接:

ln -s /mnt/app/shared/bundle/ruby/1.9.1/bundle/gems/mongrel* \
 /mnt/app/shared/bundle/ruby/1.9.1/gems/mongrel-1.2.0.beta.1

这显然是捆绑器可以自动完成的简单操作。异常的完整跟踪是:

/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/app/shared/bundle/ruby/1.9.1/gems/mongrel-1.2.0.beta.1/lib/mongrel/init.rb (MissingSourceFile)
    from /mnt/app/shared/bundle/ruby/1.9.1/gems/activesupport-2.3.8/lib/active_support/dependencies.rb:166:in `require'
    from /mnt/app/shared/bundle/ruby/1.9.1/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:134:in `block in load'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:241:in `each'
    from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/source_index.rb:241:in `each'
    from /mnt/services/shared/bundle/ruby/1.9.1/gems/gem_plugin-0.2.3/lib/gem_plugin.rb:112:in `load'
    from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/mongrel-f3e69eb8e6fb/lib/mongrel/configurator.rb:231:in `load_plugins'
于 2010-10-07T01:11:06.613 回答