Question

I am currently deploying my application and for some odd reason I keep getting this error when doing cap:deploy. I have tried everything on the face of the internet and cannot find a solution to this problem

*** [deploy:update_code] rolling back
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'default' -c 'git clone -q --depth 1 git@github.com:username/appname.git /var/www/site/app/releases/20130215074544 && cd /var/www/site/app/releases/20130215074544 && git checkout -q -b deploy ab30e0f75c1876026a6c658094170e73 && (echo ab30e0f75c1876026a6c658094170e73 > /var/www/site/app/releases/20130215074544/REVISION)'" on xxx.xxx.xx.xxx

I am not sure what this means and have tried everything suggested from stackoverflow questions to google and nothing has work.

I've even tried this in my deploy file but nothings has worked

require "rvm/capistrano"
set :rvm_ruby_string, 'default'
set :rvm_type, :system

gemfile

group :development, :test do
  gem "capistrano", "~> 2.14.2"
  gem 'rvm-capistrano', '~> 1.3.0.rc9'
end

deploy.rb

set :rvm_ruby_string, :local        # use the same ruby as used locally for deployment

before 'deploy', 'rvm:install_rvm'  # update RVM
before 'deploy', 'rvm:install_ruby' # install Ruby and create gemset (both if missing)

require "rvm/capistrano"

    set :application, "appname"
    set :repository, "git@github.com:username/appname.git"

    set :scm, 'git'

    role :web, "xxx.xxx.xx.xxx" # Your HTTP server, Apache/etc
    role :app, "xxx.xxx.xx.xxx" # This may be the same as your `Web` server
    role :db, "xxx.xxx.xx.xxx", :primary => true # This is where Rails migrations will run

    set :user, 'usernameyousetupforserver'
    set :branch, "master"
    set :rvm_type, :user

    set :git_shallow_clone, 1
    set :use_sudo, false
    set :deploy_to, "/path/public/#{application}"
    set :deloy_via, :remote_cache
    set :keep_releases, 1
    set :rails_env, "production"
    set :migrate_target, :latest

    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

     namespace :deploy do
       desc "Recreate symlink"
       task :resymlink, :roles => :app do
         run "rm -f #{current_path} && ln -s #{release_path} #{current_path}"
       end
     end

Development Log

    * 2013-02-16 12:39:55 executing `deploy'
* 2013-02-16 12:39:55 executing `deploy:update'
* transaction: start
* 2013-02-16 12:39:55 executing `deploy:update_code'
  executing locally: "git ls-remote git@github.com:username/appname.git master"
  command finished in 1310ms
* executing "git clone -q --depth 1 git@github.com:username/appname.git /var/www/site/app/releases/20130216183956 && cd /var/www/site/app/releases/20130216183956 && git checkout -q -b deploy ab30e0f75c1876026a6c658094170e73 && (echo ab30e0f75c1876026a6c658094170e73 > /var/www/site/app/releases/20130216183956/REVISION)"
  servers: ["xxx.xxx.xx.xxx"]
ssword: 
  [xxx.xxx.xx.xxx] executing command
  command finished in 22960ms
* 2013-02-16 12:40:24 executing `deploy:finalize_update'
  triggering before callbacks for `deploy:finalize_update'
* 2013-02-16 12:40:24 executing `deploy:assets:symlink'
* executing "rm -rf /var/www/site/app/releases/20130216183956/public/assets &&\\\n        mkdir -p /var/www/site/app/releases/20130216183956/public &&\\\n        mkdir -p /var/www/site/app/shared/assets &&\\\n        ln -s /var/www/site/app/shared/assets /var/www/site/app/releases/20130216183956/public/assets"
  servers: ["xxx.xxx.xx.xxx"]
  [xxx.xxx.xx.xxx] executing command
  command finished in 716ms
* executing "chmod -R -- g+w /var/www/site/app/releases/20130216183956 && rm -rf -- /var/www/site/app/releases/20130216183956/public/system && mkdir -p -- /var/www/site/app/releases/20130216183956/public/ && ln -s -- /var/www/site/app/shared/system /var/www/site/app/releases/20130216183956/public/system && rm -rf -- /var/www/site/app/releases/20130216183956/log && ln -s -- /var/www/site/app/shared/log /var/www/site/app/releases/20130216183956/log && rm -rf -- /var/www/site/app/releases/20130216183956/tmp/pids && mkdir -p -- /var/www/site/app/releases/20130216183956/tmp/ && ln -s -- /var/www/site/app/shared/pids /var/www/site/app/releases/20130216183956/tmp/pids"
  servers: ["xxx.xxx.xx.xxx"]
  [xxx.xxx.xx.xxx] executing command
  command finished in 521ms
  triggering after callbacks for `deploy:update_code'
* 2013-02-16 12:40:25 executing `deploy:assets:precompile'
* executing "cd /var/www/site/app/releases/20130216183956 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
  servers: ["xxx.xxx.xx.xxx"]
  [xxx.xxx.xx.xxx] executing command
* [out :: xxx.xxx.xx.xxx] Could not find aws-sdk-1.8.2 in any of the sources
* [out :: xxx.xxx.xx.xxx] Run `bundle install` to install missing gems.
  command finished in 1132ms
* [deploy:update_code] rolling back
* executing "rm -rf /var/www/site/app/releases/20130216183956; true"
  servers: ["xxx.xxx.xx.xxx"]
  [xxx.xxx.xx.xxx] executing command
  command finished in 508ms
Failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell 'ruby-1.9.3-p385' -c 'cd /var/www/site/app/releases/20130216183956 && rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on xxx.xxx.xx.xxx

What is causing this error and what can I do to solve it?

Was it helpful?

Solution

it looks like you missed to read documentation https://github.com/wayneeseguin/rvm-capistrano#readme

a new version 1.3.0.rc11 is described here: https://github.com/wayneeseguin/rvm-capistrano/blob/feature/readme_for_1.3.0/README.md

I see do not have bundler integration in the script:

require "rvm/capistrano"
require "bundler/capistrano"
load 'deploy/assets'

here is my deploy script for example app https://github.com/mpapis/ad/blob/master/config/deploy.rb

OTHER TIPS

go to your github settings ssh section and add the ssh public key of your remote server user to your keys. this key is under /home/username/.ssh/id_rsa.pub on linux.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top