Capistrano Deploy failing error for rails - bundle: not found

iCyborg picture iCyborg · Mar 13, 2013 · Viewed 11.5k times · Source

This is the first time I am deploying and getting errors.

here is my deploy.rb file require 'bundler/capistrano' set :application, "app"

set :scm, :git
set :repository,  "[email protected]:myname/#{application}.git"
set :branch, "master"

server "198.12.78.92", :web, :app, :db, primary: true
set :user, "myname"
set :deploy_to, "/home/#{user}/public_html/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false

default_run_options[:pty] = true
ssh_options[:forward_agent] = true

 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

Here is the error I am getting.

*** [deploy:update_code] rolling back
  * executing "rm -rf /home/myname/public_html/app/releases/20130313073408; true"
    servers: ["198.12.78.92"]
    [198.12.78.92] executing command
    command finished in 891ms
failed: "sh -c 'cp -RPp /home/myname/public_html/app/shared/cached-copy /home/myname/public_html/app/releases/20130313073408 && (echo dd92017bc8bb7f951df52d6a14c933e3033fd24b > /home/myname/public_html/app/releases/20130313073408/REVISION)'" on 198.12.78.92

EDIT - I have commented "set :deploy_via, :remote_cache" and now getting bundle: not found error though

Answer

Peter Andersson picture Peter Andersson · Mar 22, 2013

OK It seems the answer is (see my comment to your question):

Have a recent rvm installed on both your workstation and the server (I have 1.17.1).

add:

gem 'rvm-capistrano'

to your Gemfile (inside group :development as the capistrano gem)

add:

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

to your config/deploy.rb

That should do it