carlhuda/bundler — Issue #1581: Capistrano script broken for bundler ?
Author: rtdp
Created: 2011-12-07 21:08:02+00:00
State: open

If I try to deploy on server, it is giving error as -

````
command finished in 533ms
triggering after callbacks for `deploy:finalize_update'
* executing `bundle:install'
triggering before callbacks for `bundle:install'
* executing `deploy:copy_database_yml'
* executing "ln -s /var/www/apps/myapp/shared/config/database.yml /var/www/apps/myapp/releases/20111207164739/config/database.yml"
servers: ["pre.myapp.com"]
[pre.myapp.com] executing command
command finished in 349ms
* executing "ls -x /var/www/apps/myapp/releases"
servers: ["pre.myapp.com"]
[pre.myapp.com] executing command
command finished in 353ms
* executing "cd /var/www/apps/myapp/releases/log && bundle install --gemfile /var/www/apps/myapp/releases/log/Gemfile --path /var/www/apps/myapp/shared/bundle --deployment --quiet --without development test"
servers: ["pre.myapp.com"]
[pre.myapp.com] executing command
*** [err :: pre.myapp.com] cd: 1:
*** [err :: pre.myapp.com] can't cd to /var/www/apps/myapp/releases/log
*** [err :: pre.myapp.com]
command finished in 360ms
*** [deploy:update_code] rolling back
* executing "rm -rf /var/www/apps/myapp/releases/20111207164739; true"
servers: ["pre.myapp.com"]
[pre.myapp.com] executing command
command finished in 356ms
failed: "sh -c 'cd /var/www/apps/myapp/releases/log && bundle install --gemfile /var/www/apps/myapp/releases/log/Gemfile --path /var/www/apps/myapp/shared/bundle --deployment --quiet --without development test'" on pre.myapp.com

````
So it seems it is trying cd in releases/log file rather than releases/:release_version/
I have configured it for multistage deployment for staging and production.

this is what i have within my deploy.rb file -

`````
set :stages, %w(staging production)
set :default_stage, "staging"
require 'capistrano/ext/multistage'
require 'bundler/capistrano'
load 'deploy/assets'

set :whenever_command, "bundle exec whenever"
set :whenever_environment, defer { stage }
set :whenever_identifier, defer { "#{application}_#{stage}" }
require "whenever/capistrano"

set :application, "myapp"

`````
bundler version - 1.0.21
capistrano version - 2.9.0