0

I'm trying to get capistrano working with rvm and passenger standalone. I had it working at one point, then capistrano suddenly started complaining about missing the bundle command. When I remove require 'bundler/capistrano', it no longer complains about missing bundle (and no longer attempts to bundle) but fails with the following:

...
* 2013-07-25 14:29:16 executing `deploy:restart'
* executing "if [[ -f /home/staging/capistrano/shared/tmp/pids/passenger.80.pid ]];\\\n      then\\\n        cd /home/staging/capistrano/current && rvmsudo passenger stop -p 80;\\\n      fi"
  servers: ["ccdev.dyndns.org"]
  [ccdev.dyndns.org] executing command
** [out :: ccdev.dyndns.org] sh: 1:
** [out :: ccdev.dyndns.org] [[: not found
** [out :: ccdev.dyndns.org]
  command finished in 13ms
* executing "cd /home/staging/capistrano/current && rvmsudo passenger start -e staging -p 80 -d"
  servers: ["ccdev.dyndns.org"]
  [ccdev.dyndns.org] executing command
** [out :: ccdev.dyndns.org] sh: 1:
** [out :: ccdev.dyndns.org] rvmsudo: not found
** [out :: ccdev.dyndns.org]
  command finished in 13ms
failed: "env rvmsudo_secure_path=1 sh -c 'cd /home/staging/capistrano/current && rvmsudo passenger start -e staging -p 80 -d'" on ccdev.dyndns.org

It seems evident that there's some path variable missing from the shell environment of my deploy user, but only when called from capistrano. All the commands in question work manually. I'm not sure where to start looking. The env rvmsudo_secure_path=1 is a result of default_run_options[:env] = {'rvmsudo_secure_path' => 1} at the top of staging.rb which stops an rvm error from showing and hanging the deploy process. It was present before when deploying worked.

Archonic
  • 314
  • 2
  • 5
  • 13

1 Answers1

1

bundler/capistrano default settings are not always the best choice, this is why it is recommended in rvm-capistrano to reset those settings back to using standard ruby paths (called system in bundler - but has nothing to do with system itself)

I maintain example application https://github.com/mpapis/ad/blob/master/config/deploy.rb the minimal extract fro you would be:

require "rvm/capistrano"
require "bundler/capistrano"

set :bundle_dir, ''
set :bundle_flags, '--system --quiet'
set :bundle_without, [:development]
mpapis
  • 334
  • 3
  • 9