Rails 3 — Bundler/Capistrano Errors

UPDATE:

For RVM >= 1.11.3, you should now just use the rvm-capistrano gem. For older RVM >= 1.0.1, the answer below still applies.


ORIGINAL ANSWER:

Okay, though I still haven’t gotten a full cap deploy to work, I did fix this problem. The problem was Capistrano trying to use a different path for Bundler (and other gems) than the RVM paths.

Check your Capistrano path by doing cap shell, then echo $PATH. You’ll probably see your standard /usr/local/bin and /usr/bin, but that’s not where RVM has Bundler, et al., stored.

Edit your Capistrano config/deploy.rb file, and add the following lines, per these instructions:

# Add RVM's lib directory to the load path.
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))

# Load RVM's capistrano plugin.    
require "rvm/capistrano"

set :rvm_ruby_string, '1.9.2'
set :rvm_type, :user  # Don't use system-wide RVM

That finally got Capistrano to see Bundler and start loading gems appropriately.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)