Trying to deploy a rails app, but when I try to run db migrations its giving me an error that it can't find bundler.

My gems are installed in /home/user/webapps/appname/gems and this is set as my gem_path, and the path contains bundler.

Any tips / hints, troubleshooting i can do?


    servers: [""]
[] executing command
command finished
triggering after callbacks for `deploy:update_code'
  • executing `bundle:install'
  • executing "bundle install --gemfile /home/myhome/webapps/myapp/releases/20101221024745/Gemfile --path /home/myhome/webapps/myapp/shared/bundle --deployment --quiet --without development test" servers: [""] [] executing command [out ::] /usr/local/ruby1.8.7ee/lib/ruby/site_ruby/1.8/rubygems.rb:779:in report_activate_error' [out ::] : [out ::] Could not find RubyGem bundler (>= 0) [out ::] ( [out ::] Gem::LoadError [out ::] ) [out ::] from /usr/local/ruby1.8.7ee/lib/ruby/site_ruby/1.8/rubygems.rb:214:inactivate' [out ::] from /usr/local/ruby1.8.7ee/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem' [out ::] from /home/myhome/webapps/myapp/gems/bin/bundle:18 command finished * [deploy:update_code] rolling back
  • executing "rm -rf /home/myhome/webapps/myapp/releases/20101221024745; true" servers: [""] [] executing command command finished failed: "env PATH=$PATH:/home/myhome/webapps/myapp/gems/bin GEM_PATH=/home/myhome/webapps/myapp/shared/bundle GEM_HOME=/home/myhome/webapps/myapp/shared/bundle sh -c 'bundle install --gemfile /home/myhome/webapps/myapp/releases/20101221024745/Gemfile --path /home/myhome/webapps/myapp/shared/bundle --deployment --quiet --without development test'" on domain

asked 07 Dec '10, 12:46

THEM's gravatar image

accept rate: 0%

edited 20 Dec '10, 21:07

Can you please post the full error message? You can edit out your username, but other than that we need to see the entire message. Thanks!

(07 Dec '10, 12:54) seanf ♦♦ seanf's gravatar image

Has anyone found a good solution for this?

The problem I think (or one way to look at the problem) is that SSH has no knowledge of the path to the bundle executable.

Browsing around for a bit, I found that if PermitUserEnvironment yes is enabled in /etc/ssh/sshd_config, then you can create the text file ~/.ssh/environment, and include the environment paths that SSH can access, for example (this won't work on Webfaction):



Or whatever. But I'm not sure what the correct paths are for Webfaction, and I'm not sure if support can enable PermitUserEnvironment.

Are there any better answers for this?

permanent link

answered 27 Jan '11, 02:57

kevindickerson's gravatar image

accept rate: 0%

For future reference, this is what I currently have in my deploy.rb which is working.

default_environment['PATH'] = "/home/<username>/ruby/bin:/home/<username>/rubygems-1.4.2/bin:/home/<username>/webapps/<app name>/gems/bin:$PATH"
default_environment['GEM_PATH'] = "/home/<username>/webapps/<app name>/gems"
default_environment['GEM_HOME'] = "/home/<username>/webapps/<app name>/gems"
permanent link

answered 03 Oct '11, 10:11

THEM's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 07 Dec '10, 12:46

question was seen: 3,579 times

last updated: 03 Oct '11, 10:11

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited