Topic: Capistrano Errors - Can't Find Bundler

I have a basic Rails 3 app working locally on my development box, but want to test out deploying early on to make sure everything works.  I'm using Capistrano to deploy.

When I run cap deploy (after all the other necessary setup), it breaks on this command with this error:

    * executing 'bundle:install'
    * executing "bundle install --gemfile /var/www/trex/releases/20100917172521/Gemfile --path /var/www/trex/shared/bundle --deployment --quiet --without development test"
    servers: ["www.[my domain].com"]
    [www.[my domain].com] executing command
    ** [out :: www.[my domain].com] sh: bundle: command not found
    command finished

So it looks like it can't find the bundle command on the server.

However, when I log in to the server...

    $ ruby -v
    ruby 1.9.2p0 (2010-08-18 revision 29036) [x86_64-linux]
    $ rails -v
    Rails 3.0.0
    $ bundle -v
    Bundler version 1.0.0

...the bundle command works just fine.

What could be going wrong?

(Furthermore, for the sake of completeness:)

    $ which ruby
    $ which rails
    $ which bundle

Re: Capistrano Errors - Can't Find Bundler

I've run into that problem a few times before. You have the gems installed, but Capistrano can't "find" them.

What worked for me was setting the 'GEM_PATH' in my Capistrano file.

Do you have a line like this "default_environment['GEM_PATH']=..." commented out?