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?

Thanks

    servers: ["myapp.domain.com"]
[myapp.domain.com] 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: ["myapp.domain.com"] [myapp.domain.com] executing command [out :: myapp.domain.com] /usr/local/ruby1.8.7ee/lib/ruby/site_ruby/1.8/rubygems.rb:779:in report_activate_error' [out :: myapp.domain.com] : [out :: myapp.domain.com] Could not find RubyGem bundler (>= 0) [out :: myapp.domain.com] ( [out :: myapp.domain.com] Gem::LoadError [out :: myapp.domain.com] ) [out :: myapp.domain.com] from /usr/local/ruby1.8.7ee/lib/ruby/site_ruby/1.8/rubygems.rb:214:inactivate' [out :: myapp.domain.com] from /usr/local/ruby1.8.7ee/lib/ruby/site_ruby/1.8/rubygems.rb:1082:in `gem' [out :: myapp.domain.com] 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: ["myapp.domain.com"] [myapp.domain.com] 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 myapp.domain.com domain

asked 07 Dec '10, 12:46

THEM's gravatar image

THEM
717
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):

PATH=/usr/local/rvm/gems/ruby-1.9.2-p0/bin:/bin:/usr/local/rvm/rubies/ruby-1.9.2-p0/bin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

GEM_HOME=/usr/local/rvm/gems/ruby-1.9.2-p0

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?

link

answered 27 Jan '11, 02:57

kevindickerson's gravatar image

kevindickerson
2126
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"
link

answered 03 Oct '11, 10:11

THEM's gravatar image

THEM
717
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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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

Tags:

×92
×19
×7

Asked: 07 Dec '10, 12:46

Seen: 2,526 times

Last updated: 03 Oct '11, 10:11

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited