sowasred2012
sowasred2012

Reputation: 735

Capistrano deployment issues

I've been wrestling with Capistrano, trying to deploy a test rails app for a couple of days, and I think I'm almost there, but I'm getting this error when I run cap deploy:

failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'default' -c 'cd var/rails/test_app/current/releases/20120619215252 && bundle install --gemfile var/rails/test_app/current/releases/20120619215252/Gemfile --path var/rails/test_app/current/shared/bundle --deployment --quiet --without development test'" on my.vps.ip.address

What does it mean and how can I resolve the issue?

Thanks!

This is my deploy.rb file, if it helps:

# RVM

$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, 'default'
set :rvm_type, :system

# Bundler

require "bundler/capistrano"

# General

set :application, "test_app"
set :user, "rails"

set :deploy_to, "var/rails/test_app/current"
set :deploy_via, :copy

set :use_sudo, false

# Git

set :scm, :git
set :repository,  "~/Projects/test_app/.git"
set :branch, "master"

# VPS

role :web, "my.vps.ip.address"
role :app, "my.vps.ip.address"
role :db,  "my.vps.ip.address", :primary => true
role :db,  "my.vps.ip.address"

# Passenger

namespace :deploy do
 task :start do ; end
 task :stop do ; end
 task :restart, :roles => :app, :except => { :no_release => true } do
  run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}"
 end
end

Upvotes: 0

Views: 806

Answers (1)

Julien Pellet
Julien Pellet

Reputation: 2753

Capistrano is trying to go in the latest deployment folder and run "bundle install". The problem seems to be the folder where capistrano tries to do this : You are doing cd var/rails/test_app/current/releases/20120619215252 && bundle install ... A / is missing at the start of the path, that should be /var/rails... You should have made a mistake overriding the path somewhere in the recipe.

Seeing your recipe you should have ( watch for the / )

set :deploy_to, "/var/rails/test_app/"

Don't specify the "current" folder, this is a capistrano default behavior. Be sure that /var/rails/test_app/ is owned by the user used for deployment. Else : chown -R rails:rails /var/rails/test_app/ rails:rails, because you set :user, "rails" in your recipe.

Also don't forget to cap deploy:setup to build the directory structure...

Upvotes: 2

Related Questions