Skip to content

Instantly share code, notes, and snippets.

@jpinnix
Created August 31, 2010 04:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jpinnix/558528 to your computer and use it in GitHub Desktop.
Save jpinnix/558528 to your computer and use it in GitHub Desktop.
App details:
Rails 3.0.0
Bundler 1.0
http://github.com/challengepost/postmark-rails (fork for Rails 3)
Ran bundle install, everything installed correctly. Checked in Gemfile.lock and
added 'require "bundler/capistrano"' to deploy.rb. Works totally fine on local.
But on deploy it locks up when trying to init submodules:
No submodule mapping found in .gitmodules for path
'vendor/bundle/ruby/1.8/bundler/gems/postmark-rails-3b8a5bb3c168'
When I remove the Cap recipe, remove Gemfile.lock and deploy, I can then
"bundle install" directly on the server and it works fine.
So then I set up an empty Rails 3 app and just tried to deploy that.
Ran bundle install, everything installed correctly. Checked in Gemfile.lock
and added 'require "bundler/capistrano"' to deploy.rb. Works totally fine
on local. But on deploy it gives the following error:
sh: bundle: not found
failed: "sh -c 'bundle install --gemfile
/home/redacted/releases/20100831040156/Gemfile --path
/home/redacted/shared/bundle --deployment --quiet
--without development test'" on redacted.pixelgrazer.com
Once again, removing the cap recipe and lock file, I can deploy and
run "bundle install" on the server and everything is fine again.
Any ideas would be greatly appreciated.
@erichurst
Copy link

Hi Jeremy,

Did you ever come across a solution for this? I'm experiencing the same issue.

Thanks,

Eric

@jpinnix
Copy link
Author

jpinnix commented May 7, 2011

Hey Eric!

If I recall, the issue was that the prod environment couldn't find bundle.

Try setting bundle_cmd like so:

set :bundle_cmd, "/usr/local/ree/bin/bundle"

Hope this helps!
jeremy

@erichurst
Copy link

I'm embarrassed to say what the issue was, as it was my own stupid fault. For future generations and other problem seekers, though, I'll bare my ass.

My problem actually ended up being a bit different from Jeremy's. I was running in to this on deploy: https://gist.github.com/973783.

Pay close attention to the clue on line #19. My gems had been installed in to vendor/cache/ruby, rather than vendor/cache. A subtle but extremely frustrating problem. It is the result of me not entirely knowing what I was doing when I ran bundle install --path vendor/cache.

To fix, I did the following:

  • removed the line from .bundle/config that listed vendor/cache as the GEM_PATH
  • rm -rf vendor/cache
  • rm Gemfile.lock (for good measure)
  • bundle install
  • commit, then push

This returned all gems to their rightful place in the gemset, and my deploy was back to normal.

Hope this helps someone. Thanks to Jeremy for leaving this gist up.

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