mongrel from git source fails with bundler...simple fix (consolidate gems and bundler/gems) #200

tribalvibes opened this Issue Oct 7, 2010 · 0 comments


None yet

1 participant


Transitioning to bundler with an existing production setup. Naively with a gemfile and setup like:
gem "rails", "2.3.8"
gem "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)

The problem seems to be an interaction of bundler and mongrel's use of the gem_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 the git source, it's looking in bundle/ruby/1.9.1/gems/mongrel_ instead of bundle/ruby/1.9.1/bundler/gems/mongrel_ which is where bundler is stashing the gem cloned from git.

So the solution that worked for our config is to just symlink them:
ln -s /mnt/app/shared/bundle/ruby/1.9.1/bundle/gems/mongrel* \

This is clearly something simple that bundler could do automatically. Full trace of the exception was:
/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
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
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
from /mnt/app/shared/bundle/ruby/1.9.1/bundler/gems/mongrel-f3e69eb8e6fb/lib/mongrel/configurator.rb:231:in `load_plugins'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment