I am trying to run cap deploy
on a project. I keep getting this error, I am not sure where it comes from:
➜ example git:(master) cap deploy
* 2016-04-04 19:19:10 executing `deploy'
* 2016-04-04 19:19:10 executing `deploy:update'
** transaction: start
* 2016-04-04 19:19:10 executing `deploy:update_code'
executing locally: "git ls-remote [email protected]:tdelam/example.git HEAD"
command finished in 807ms
* executing "git clone -q [email protected]:tdelam/example.git /srv/rails_apps/example/releases/20160404231911 && cd /srv/rails_apps/example/releases/20160404231911 && git checkout -q -b deploy 24f9d11882b2481d4c2f0cac1fe87095f265cfea && (echo 24f9d11882b2481d4c2f0cac1fe87095f265cfea > /srv/rails_apps/example/releases/20160404231911/REVISION)"
servers: ["56.223.75.114"]
[56.223.75.114] executing command
command finished in 2598ms
* 2016-04-04 19:19:14 executing `deploy:finalize_update'
triggering before callbacks for `deploy:finalize_update'
* 2016-04-04 19:19:14 executing `deploy:assets:symlink'
* executing "rm -rf /srv/rails_apps/example/releases/20160404231911/public/assets && mkdir -p /srv/rails_apps/example/releases/20160404231911/public && mkdir -p /srv/rails_apps/example/shared/assets && ln -s /srv/rails_apps/example/shared/assets /srv/rails_apps/example/releases/20160404231911/public/assets"
servers: ["56.223.75.114"]
[56.223.75.114] executing command
command finished in 22ms
* 2016-04-04 19:19:14 executing `bundle:install'
* executing "cd /srv/rails_apps/example/releases/20160404231911 && bundle install --gemfile /srv/rails_apps/example/releases/20160404231911/Gemfile --path /srv/rails_apps/example/shared/bundle --deployment --quiet --without development test"
servers: ["56.223.75.114"]
[56.223.75.114] executing command
** [out :: 56.223.75.114] Could not find rake-11.1.2 in any of the sources
command finished in 6530ms
*** [deploy:update_code] rolling back
* executing "rm -rf /srv/rails_apps/example/releases/20160404231911; true"
servers: ["56.223.75.114"]
[56.223.75.114] executing command
command finished in 34ms
failed: "sh -c 'cd /srv/rails_apps/example/releases/20160404231911 && bundle install --gemfile /srv/rails_apps/example/releases/20160404231911/Gemfile --path /srv/rails_apps/example/shared/bundle --deployment --quiet --without development test'" on 56.223.75.114
My capfile is pretty simple:
set :application, "example"
set :repository, "[email protected]:tdelam/example.git"
#set :rvm_type, :system
set :scm, :git
# Or: `accurev`, `bzr`, `cvs`, `darcs`, `git`, `mercurial`, `perforce`, `subversion` or `none`
set :user, "jeffc"
set :deploy_to, "/srv/rails_apps/#{application}"
set :use_sudo, true
set :keep_releases, 5
role :web, "56.223.75.114" # Your HTTP server, Apache/etc
role :app, "56.223.75.114" # This may be the same as your `Web` server
role :db, "56.223.75.114", :primary => true # This is where Rails migrations will run
role :db, "56.223.75.114"
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
and last but not least, here is the rake version it is complaining about:
➜ example git:(master) rake --version
rake, version 11.1.2
This rake version is both on my development machine as well as my server
EDIT: My ruby version on the server is ruby 2.1.4p265 (2014-10-27 revision 48166) [x86_64-linux]
Here is my Gemfile: source 'https://rubygems.org'
gem 'rails', '3.2.15'
group :development, :test do
gem 'sqlite3'
gem 'capistrano', '~> 2.15.7'
gem 'thin'
#gem 'rvm-capistrano'
end
# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.2.3'
gem 'coffee-rails', '~> 3.2.1'
gem 'execjs'
gem 'therubyracer'
gem 'uglifier', '>= 1.0.3'
end
group :production do
gem 'mysql2','> 0.3'
end
gem 'jquery-rails'
# Refinery CMS
gem 'refinerycms', '~> 2.1.0'
# Optionally, specify additional Refinery CMS Extensions here:
gem 'refinerycms-acts-as-indexed', '~> 1.0.0'
Does anyone have a suggestion as to what's going on?
Make sure that bundler
was installed without sudo user and try to remove use_sudo from Capfile:
set :use_sudo, false
To help I created a step-by-step to create a ruby on rails project using Capistrano on Ubuntu 14.04: https://gist.github.com/Godoy/7a04acf42a382bd03ed1
Works pretty well in my projects. Good lucky!
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments