How to get mongrel working with bundler?

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

  • Fetching git behind proxy in docker container
  • Gemfile.lock not checked in - Heroku
  • Bundler keeps removing 'BUNDLED WITH' section of Gemfile.lock
  • Force bundle install to use https:// instead of git:// for GitHub-based gems
  • Ruby “bundle install” error on Openshift
  • Can't run Jenkins Build - bundle: “command not found”
  • 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?

  • Why does git store objects in directories with the first two characters of the hash?
  • git: How do I get the latest version of my code?
  • share git repo between two computers locally
  • Can I make TortoiseGit remember by password? (using multiple BitBucket accounts)
  • how to start bash in a directory in windows .bat?
  • Broken pipe when pushing to git repository
  • One Solution collect form web for “How to get mongrel working with bundler?”

    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 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 `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'
    Git Baby is a git and github fan, let's start git clone.