rvm1-capistrano3 error not finding ruby - ruby

I'm heaving troubles with deploy script. it's failing with following output -
DEBUG[3852918b] Command: cd
/var/www/billing.staging/releases/20140829073745 &&
/tmp/billing-deploy/rvm-auto.sh 2.1.2 gem install --file Gemfile
DEBUG[3852918b] ruby-2.1.2 is not installed. DEBUG[3852918b] Ruby
ruby-2.1.2 is not installed. DEBUG[3852918b] Can not find ruby for
'2.1.2'. cap aborted! SSHKit::Runner::ExecuteError: Exception while
executing on host 5.9.119.212: gem exit status: 103 gem stdout:
Nothing written gem stderr: ruby-2.1.2 is not installed. Ruby
ruby-2.1.2 is not installed. Can not find ruby for '2.1.2'.
my script :
# config valid only for Capistrano 3.1
lock '3.1.0'
set :application, 'billing'
set :repo_url, 'git#github.com:aviacentr/Billing.git'
set :keep_releases, 5
set :linked_files, %w{config/database.yml config/secrets.yml config/billing.yml}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# Default branch is :master
# ask :branch, proc { `git rev-parse --abbrev-ref HEAD`.chomp }
# Default deploy_to directory is /var/www/my_app
# set :deploy_to, '/var/www/my_app'
set :bundle_servers, -> { release_roles(fetch(:bundle_roles)) } # this is default
set :bundle_binstubs, -> { shared_path.join('bin') } # this is default
set :bundle_gemfile, -> { release_path.join('Gemfile') } # default: nil
set :bundle_path, -> { shared_path.join('bundle') } # this is default
set :bundle_without, %w{development test}.join(' ') # this is default
set :bundle_flags, '--deployment --quiet ' # this
# is default
set :bundle_env_variables, {}
set :rvm1_ruby_version, "2.1.2"
# this is default
# Default value for :scm is :git
# set :scm, :git
# Default value for :format is :pretty
set :format, :pretty
# Default value for :log_level is :debug
# set :log_level, :debug
# Default value for :pty is false
# set :pty, true
# Default value for :linked_files is []
# set :linked_files, %w{config/database.yml}
# Default value for linked_dirs is []
# set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# require 'mongodb_logger/capistrano'
# set :mongodb_logger_assets_dir, "public/assets" # where to put mongodb assets
# after 'deploy:update_code', 'mongodb_logger:precompile'
# Default value for keep_releases is 5
set :keep_releases, 3
set :branch, ENV['branch'] || 'master' # e.g. cap staging deploy branch=dev
namespace :deploy do
desc 'Restart application'
task :restart do
on roles(:app), in: :sequence, wait: 5 do
# Your restart mechanism here, for example:
# execute :touch, release_path.join('tmp/restart.txt')
end
end
after :publishing, :restart
after :restart, :clear_cache do
on roles(:web), in: :groups, limit: 3, wait: 10 do
# Here we can do anything such as:
# within release_path do
# execute :rake, 'cache:clear'
# end
end
end
end
after 'deploy:publishing', 'deploy:restart'
namespace :deploy do
task :restart do
invoke 'unicorn:restart'
end
end
before 'deploy', 'rvm1:install:rvm'
before 'deploy', 'rvm1:install:ruby' # install/update Ruby
before 'deploy', 'rvm1:install:gems'
before 'deploy', 'rvm1:hook'
# after 'deploy:publishing', 'binstubs'
# task :binstubs do
# run 'gem regenerate_binstubs'
# end
Could you help me with this issue?

Related

Capistrano deploy - stuck at step 03

I've been playing with capistrano deploy, I managed to connect to my server, but now I am stuck at step 03, but I don't have log errors and I don't know which might be the next thing to do.
Help is highly appreciate. I don't whant you to solve by me of course not. I just want some guidance, thank you.
$ cap production deploy --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke deploy (first_time)
** Execute deploy
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 vlmg#vlmg.mx 0.249s
Uploading /tmp/git-ssh-vlmg-forms-production-ubuntu.sh 100.0%
02 chmod 700 /tmp/git-ssh-vlmg-forms-production-ubuntu.sh
✔ 02 vlmg#vlmg.mx 0.055s
This is my deploy.rb
# config valid only for current version of Capistrano
lock '3.6.0'
set :application, 'vlmg-forms'
set :repo_url, 'git#github.com:jose-octomedia/ar-vlmg-contact-forms.git'
# Default branch is :master
# ask :branch, `git rev-parse --abbrev-ref HEAD`.chomp
# Default deploy_to directory is /var/www/my_app_name
#set :deploy_to, '/'
# Default value for :scm is :git
# set :scm, :git
# Default value for :format is :airbrussh.
# set :format, :airbrussh
# You can configure the Airbrussh format using :format_options.
# These are the defaults.
# set :format_options, command_output: true, log_file: 'log/capistrano.log', color: :auto, truncate: :auto
# Default value for :pty is false
set :pty, true
# Default value for :linked_files is []
# append :linked_files, 'config/database.yml', 'config/secrets.yml'
# Default value for linked_dirs is []
# append :linked_dirs, 'log', 'tmp/pids', 'tmp/cache', 'tmp/sockets', 'public/system'
# Default value for default_env is {}
# set :default_env, { path: "/opt/ruby/bin:$PATH" }
# Default value for keep_releases is 5
# set :keep_releases, 5
desc 'Restart application'
task :restart do
on roles(:web), in: :sequence, wait: 5 do
execute "service thin restart" ## -> line you should add
end
end
And this is my production.rb file
# server-based syntax
# ======================
# Defines a single server with a list of roles and multiple properties.
# You can define all roles on a single server, or split them:
server 'vlmg.mx', user: 'vlmg', roles: %w{web}, primary: true, port: 15555
# server 'example.com', user: 'deploy', roles: %w{app web}, other_property: :other_value
# server 'db.example.com', user: 'deploy', roles: %w{db}
set :deploy_to, "/home/vlmg/subdomains/ar.vlmg.mx"
# role-based syntax
# ==================
# Defines a role with one or multiple servers. The primary server in each
# group is considered to be the first unless any hosts have the primary
# property set. Specify the username and a domain or IP for the server.
# Don't use `:all`, it's a meta role.
#role :app, %w{admin#example.com}, my_property: :my_value
role :web, %w{vlmg#vlmg.mx}
# role :db, %w{deploy#example.com}
# Configuration
# =============
# You can set any configuration variable like in config/deploy.rb
# These variables are then only loaded and set in this stage.
# For available Capistrano configuration variables see the documentation page.
# http://capistranorb.com/documentation/getting-started/configuration/
# Feel free to add new variables to customise your setup.
# Custom SSH Options
# ==================
# You may pass any option but keep in mind that net/ssh understands a
# limited set of options, consult the Net::SSH documentation.
# http://net-ssh.github.io/net-ssh/classes/Net/SSH.html#method-c-start
#
# Global options
# --------------
set :ssh_options, {
keys: %w(/home/ubuntu/.ssh/id_rsa),
forward_agent: true
#auth_methods: %w(password)
}
#
# The server-based syntax can be used to override options:
# ------------------------------------
# server 'example.com',
# user: 'user_name',
# roles: %w{web app},
# ssh_options: {
# user: 'user_name', # overrides user setting above
# keys: %w(/home/ubuntu/.ssh/id_rsa),
# forward_agent: false,
## auth_methods: %w(publickey password)
# # password: 'please use keys'
# }
Edit: In response of enabling the logs. This is the results.
Still nothing in the logs that could help to solve.
INFO ---------------------------------------------------------------------------
INFO START 2016-08-10 19:49:49 +0000 cap production deploy
INFO ---------------------------------------------------------------------------
INFO [204569e4] Running /usr/bin/env mkdir -p /tmp as vlmg#vlmg.mx
DEBUG [204569e4] Command: /usr/bin/env mkdir -p /tmp
INFO [9596edc0] Running /usr/bin/env mkdir -p /tmp as vlmg#vlmg.mx
DEBUG [9596edc0] Command: /usr/bin/env mkdir -p /tmp
INFO [9596edc0] Finished in 0.288 seconds with exit status 0 (successful).
DEBUG Uploading /tmp/git-ssh-vlmg-forms-production-ubuntu.sh 0.0%
INFO Uploading /tmp/git-ssh-vlmg-forms-production-ubuntu.sh 100.0%
INFO [1014be51] Running /usr/bin/env chmod 700 /tmp/git-ssh-vlmg-forms-production-ubuntu.sh as vlmg#vlmg.mx
DEBUG [1014be51] Command: /usr/bin/env chmod 700 /tmp/git-ssh-vlmg-forms-production-ubuntu.sh
INFO [1014be51] Finished in 0.057 seconds with exit status 0 (successful).
After last command this are the results, basically the same, hanging for 20-30 seconds then:
00:00 git:wrapper
01 mkdir -p /tmp
✔ 01 vlmg#vlmg.mx 0.265s
Uploading /tmp/git-ssh-vlmg-forms-production-ubuntu.sh 100.0%
02 chmod 700 /tmp/git-ssh-vlmg-forms-production-ubuntu.sh
✔ 02 vlmg#vlmg.mx 0.063s
(Backtrace restricted to imported tasks)
cap aborted!
Net::SSH::ConnectionTimeout: Net::SSH::ConnectionTimeout
Errno::ETIMEDOUT: Connection timed out - connect(2) for 109.73.225.169:22
Tasks: TOP => git:wrapper
(See full trace by running task with --trace)
This step 03 is solved, thanks. Solution was specify port on ssh connection too.
set :ssh_options, {
keys: %w(/home/ubuntu/.ssh/id_rsa),
forward_agent: true,
port: 15555,
#auth_methods: %w(password)
}
Now I have new errors, but I think that should could be in another post.

PhantomJs crashing when testing Jasmine from the command line

I'm running Jasmine js tests on a project. I'm using the jasmine ruby gem to run my tests. I had everything working with some sample tests earlier but when I updated the jasmine.yml file with some new tests my tests no longer run.
When I try to run from the command line with rake jasmine:ci I get a segmentation fault in PhantomJs.
My jasmine.yml file looks like this:
# src_files
#
# Return an array of filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# src_files:
# - lib/source1.js
# - lib/source2.js
# - dist/**/*.js
#
src_files:
- app/javascripts/beatView.js
# stylesheets
#
# Return an array of stylesheet filepaths relative to src_dir to include before jasmine specs.
# Default: []
#
# EXAMPLE:
#
# stylesheets:
# - css/style.css
# - stylesheets/*.css
#
stylesheets:
- assets/application.css
# helpers
#
# Return an array of filepaths relative to spec_dir to include before jasmine specs.
# Default: ["helpers/**/*.js"]
#
# EXAMPLE:
#
# helpers:
# - helpers/**/*.js
#
helpers:
- 'helpers/**/*.js'
# spec_files
#
# Return an array of filepaths relative to spec_dir to include.
# Default: ["**/*[sS]pec.js"]
#
# EXAMPLE:
#
# spec_files:
# - **/*[sS]pec.js
#
spec_files:
- 'spec/javascripts//backbone/views/beat_spec.js'
# src_dir
#
# Source directory path. Your src_files must be returned relative to this path. Will use root if left blank.
# Default: project root
#
# EXAMPLE:
#
# src_dir: public
#
src_dir:
# spec_dir
#
# Spec directory path. Your spec_files must be returned relative to this path.
# Default: spec/javascripts
#
# EXAMPLE:
#
# spec_dir: spec/javascripts
#
spec_dir: spec/javascripts
# spec_helper
#
# Ruby file that Jasmine server will require before starting.
# Returned relative to your root path
# Default spec/javascripts/support/jasmine_helper.rb
#
# EXAMPLE:
#
# spec_helper: spec/javascripts/support/jasmine_helper.rb
#
spec_helper: spec/javascripts/support/jasmine_helper.rb
# boot_dir
#
# Boot directory path. Your boot_files must be returned relative to this path.
# Default: Built in boot file
#
# EXAMPLE:
#
# boot_dir: spec/javascripts/support/boot
#
boot_dir:
# boot_files
#
# Return an array of filepaths relative to boot_dir to include in order to boot Jasmine
# Default: Built in boot file
#
# EXAMPLE
#
# boot_files:
# - '**/*.js'
#
boot_files:
# rack_options
#
# Extra options to be passed to the rack server
# by default, Port and AccessLog are passed.
#
# This is an advanced options, and left empty by default
#
# EXAMPLE
#
# rack_options:
# server: 'thin'
I don't know if the issue is in the yml file or if there is something else that I may have messed up.
I figured this one out. The issue was in my jasmine.yml file. The path for the specs was spec/javascripts/ as you can see where it specified spec_dir and then I was giving the spec file as - 'spec/javascripts//backbone/views/beat_spec.js' which caused phantom to crash because of the repeated directory names.

Chef fails when trying to deploy a Torquebox app on EC2

I'm pretty new to Chef/ops in general but I'm trying to deploy on EC2 and I keep running into this error. The stack trace file mentioned in the error does not exist so that's making it kind of hard to debug the problem. Also, whenever Chef fails, the permission on my EC2 box gets denied and I have to spin up a new instance. For reference, the original source of this file is from here: http://janitor.se/blog/2013/07/04/easier-neo4j-dot-rb-deployments-with-chef-plus-capistrano-plus-torquebox/
The error looks like this:
* script[install torquebox backstage] action run
- execute "bash" "/tmp/chef-script20131011-2067-1phzfkw"
[2013-10-11T03:47:51+00:00] ERROR: Running exception handlers
[2013-10-11T03:47:51+00:00] ERROR: Exception handlers complete
[2013-10-11T03:47:51+00:00] FATAL: Stacktrace dumped to /tmp/chef-solo/chef-stacktrace.out
Chef Client failed. 71 resources updated
[2013-10-11T03:47:51+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
ERROR: RuntimeError: chef-solo failed. See output above.
My recipe file - torquebox.rb:
download_file = File.join("/tmp", File.basename(node.torquebox.download_url))
remote_file download_file do
source node.torquebox.download_url
mode 00644
action :create_if_missing
notifies :run, "script[install-torquebox]", :immediately
end
script "install-torquebox" do
Chef::Log.info("Installing torquebox zip file...")
user 'torquebox'
interpreter "bash"
code <<-EOH
unzip -o #{download_file} -d /opt/torquebox/
ln -s /opt/torquebox/torquebox-2.3.2 /opt/torquebox/current
EOH
notifies :run, "execute[change ownership to torquebox]"
not_if do
File.exists? "/opt/torquebox/torquebox-2.3.2"
end
# not_if do
# File.exists? "/opt/torquebox/torquebox-2.2.0"
# end
#action :nothing
end
template "/etc/profile.d/torquebox.sh" do
source "torquebox.sh.erb"
mode 00644
owner 'root'
variables(
:jboss_user => node[:torquebox_env][:jboss_user],
:torquebox_home => node[:torquebox_env][:home],
:jboss_pidfile => node[:torquebox_env][:jboss_pidfile],
:jboss_console_log => node[:torquebox_env][:jboss_console_log],
:jboss_config => node[:torquebox][:configuration_file],
:jruby_opts => node[:torquebox_env][:jruby_opts],
:java_environment_file => node[:java][:java_environment]
)
notifies :restart, "service[jboss-as-standalone]"
end
# install torquebox backstage
#
execute "change ownership to torquebox" do
user "root"
cwd "/opt"
Chef::Log.info("changing ownership for torquebox")
command "chown -Rv 1000.1000 /opt/torquebox"
notifies :run, "script[install torquebox backstage]"
action :nothing
end
script "install torquebox backstage" do
Chef::Log.info("Installing torquebox backstage file...")
interpreter "bash"
user "torquebox"
cwd "/opt/torquebox"
code <<-EOH
export TORQUEBOX_HOME=/opt/torquebox/torquebox-2.3.2
export JAVA_HOME=/opt/jdk7/
export JBOSS_HOME=$TORQUEBOX_HOME/jboss
export JRUBY_HOME=$TORQUEBOX_HOME/jruby
export PATH=$JBOSS_HOME/bin:$JRUBY_HOME/bin:$JAVA_HOME/bin:$PATH
EOH
# jruby -S gem install torquebox-backstage
# jruby -S gem install ruby-shadow
# jruby -S backstage deploy
not_if do
File.exists? "/opt/torquebox/current/jruby/bin/backstage"
end
end
directory '/opt/apps/' do
owner "torquebox"
group "torqubox"
mode 00755
action :create
not_if do
File.exists? "/opt/apps/"
end
end
directory "/etc/jboss-as" do
owner "root"
group "root"
mode 00755
action :create
not_if do
File.exists? "/etc/jboss-as"
end
end
directory "/var/log/jboss-as" do
owner "torquebox"
group "torquebox"
mode 00755
action :create
not_if do
File.exists? "/var/log/jboss-as"
end
end
template "/etc/init.d/jboss-as-standalone" do
source "jboss-as-standalone.sh.erb"
variables(:environment_file => node[:torquebox][:environment_file])
mode 00755
owner 'root'
notifies :restart, "service[jboss-as-standalone]"
end
service "jboss-as-standalone" do
supports :status => true, :restart => true, :stop => true, :start => true
action [ :enable, :start ]
end
#if clustered then if cluster name is staging_cluster, so proxy name will be staging_cluster_proxy
#so for every cookbook, it should be paired with two of them
proxy_nodes = []
clustered_nodes = []
Chef::Log.warn("clustered status #{node[:torquebox][:clustered]}")
if node[:torquebox][:clustered]
clustered_nodes = search(:node, "roles:#{node[:torquebox][:cluster_name]}")
proxy_nodes = search(:node, "roles:#{node[:torquebox][:cluster_name]}_proxy")
template "/opt/torquebox/current/jboss/standalone/configuration/standalone-ha.xml" do
source "standalone-ha.xml.erb"
variables(:node_name => node.name, :node_ipaddress => node.ipaddress, :cluster_name => node[:torquebox][:cluster_name], :clustered_nodes => clustered_nodes, :proxy_nodes => proxy_nodes )
mode "0644"
notifies :restart, "service[jboss-as-standalone]"
end
end
if proxy_nodes.count == 0 and node[:torquebox][:clustered] == true
Chef::Log.warn("There is no proxy defined, cluster may not function")
end
if !node[:torquebox][:clustered]
template "/opt/torquebox/current/jboss/standalone/configuration/standalone.xml" do
source "standalone.xml.erb"
variables(:node_name => node.name, :node_ipaddress => node.ipaddress)
mode "0644"
notifies :restart, "service[jboss-as-standalone]"
end
end
template "/opt/torquebox/current/jboss/bin/standalone.conf" do
source "standalone.conf.erb"
mode "00644"
owner 'torquebox'
variables(:jboss_config => node[:torquebox][:configuration_file])
notifies :restart, "service[jboss-as-standalone]"
end
cookbook_file "/etc/jboss-as/jboss-as.conf" do
source "jboss-as.conf"
mode 00644
owner 'root'
end
# NGINX!
# this enables our site, kinda like a2ensite
execute 'enable-site' do
command "ln -sf /etc/nginx/sites-available/#{node[:server_name]} /etc/nginx/sites-enabled/#{node[:server_name]}"
notifies :restart, 'service[nginx]'
end
# Our configuration template. Take a look at templates/nginx.conf.erb to see what's going on.
template "/etc/nginx/sites-available/#{node[:server_name]}" do
source 'nginx.erb'
owner 'root'
group 'root'
mode 0644
notifies :run, "execute[enable-site]", :immediately
variables(
server_name: node.server_name
)
end
service 'nginx'
service 'jboss-as-standalone'

homebrew brew doctor fail message

I am going through my home brew doctor messages and no matter what I do I can not seem to remove this message:
Warning: You have uncommitted modifications to Homebrew's core.
Unless you know what you are doing, you should run:
cd /usr/local && git reset --hard
Does anyone have any idea on how to get rid of this?
From git status /usr/local
# Library/Aliases/dwarffortress
# Library/Aliases/ultima4
# Library/Aliases/ultima7
# Library/Contributions/examples/
# Library/Formula/abfind.rb
# Library/Formula/abuse.rb
# Library/Formula/akonadi.rb
# Library/Formula/angband.rb
# Library/Formula/apc.rb
# Library/Formula/aqua-less.rb
# Library/Formula/argp-standalone.rb
# Library/Formula/attica.rb
# Library/Formula/bashreduce.rb
# Library/Formula/c10t.rb
# Library/Formula/chocolate-doom.rb
# Library/Formula/cmigemo.rb
# Library/Formula/coffee-script.rb
# Library/Formula/csstidy.rb
# Library/Formula/dosbox.rb
# Library/Formula/dotless.rb
# Library/Formula/dwarf-fortress.rb
# Library/Formula/exult.rb
# Library/Formula/flip.rb
# Library/Formula/frobtads.rb
# Library/Formula/frotz.rb
# Library/Formula/gearman-php.rb
# Library/Formula/gnu-chess.rb
# Library/Formula/gnu-go.rb
# Library/Formula/growlme.rb
# Library/Formula/imagick.rb
# Library/Formula/inform6.rb
# Library/Formula/jnethack.rb
# Library/Formula/jwhois.rb
# Library/Formula/kde-phonon.rb
# Library/Formula/kdebase-runtime.rb
# Library/Formula/kdelibs.rb
# Library/Formula/kdepimlibs.rb
# Library/Formula/libgdiplus.rb
# Library/Formula/libiconv.rb
# Library/Formula/libsgml.rb
# Library/Formula/maatkit.rb
# Library/Formula/mcrypt-php.rb
# Library/Formula/mednafen.rb
# Library/Formula/memcache-php.rb
# Library/Formula/memcached-php.rb
# Library/Formula/memcachedb.rb
# Library/Formula/midgard2-php.rb
# Library/Formula/mongo-php.rb
# Library/Formula/n2n.rb
# Library/Formula/nazghul.rb
# Library/Formula/nethack.rb
# Library/Formula/netris.rb
# Library/Formula/ninja.rb
# Library/Formula/open-tyrian.rb
# Library/Formula/orderly.rb
# Library/Formula/oxygen-icons.rb
# Library/Formula/parsley.rb
# Library/Formula/pbrt.rb
# Library/Formula/pcntl-php.rb
# Library/Formula/phpmyadmin.rb
# Library/Formula/pioneers.rb
# Library/Formula/platypus.rb
# Library/Formula/pspell-php.rb
# Library/Formula/qimageblitz.rb
# Library/Formula/robotfindskitten.rb
# Library/Formula/shared-desktop-ontologies.rb
# Library/Formula/shen.rb
# Library/Formula/slashem.rb
# Library/Formula/solr-php.rb
# Library/Formula/soprano.rb
# Library/Formula/sparse.rb
# Library/Formula/spim.rb
# Library/Formula/stone-soup.rb
# Library/Formula/strigi.rb
# Library/Formula/uggconv.rb
# Library/Formula/unnethack.rb
# Library/Formula/voldemort.rb
# Library/Formula/woof.rb
# Library/Formula/xboard.rb
# Library/Formula/xcache.rb
# Library/Formula/xdebug.rb
# Library/Formula/xmoto.rb
# Library/Formula/xu4.rb
# Library/Homebrew/test/tests
After posting on the homebrew issues log https://github.com/mxcl/homebrew/issues/11761 I was able to clear the error by running git clean -df and once that is finished brew doctor. Once complete you should see:
Your system is raring to brew.

Error occured while running task Cap deploy:setup During deployment using Capistrano with Unicorn

Here is error which occurs after running task Cap deploy:setup to deploy ubuntu server using Capistrano and Unicorn. Please help me out here if you know the answer?
here is error reflecting on terminal-
[100.116.4.74] sh -c 'cp -RPp /home/deployer/apps/mcash/shared/cached-copy /home/deployer/apps/mcash/releases/20120417074244 && (echo 8f69f0a524dcecef478bad74df4a983d3cdad480 > /home/deployer/apps/mcash/releases/20120417074244/REVISION)'
** [out :: 100.116.4.75] cp: cannot create directory `/home/deployer/apps/mcash/releases/20120417074244'
** [out :: 100.116.4.75] : No such file or directory
failed: "sh -c 'cp -RPp /home/deployer/apps/mcash/shared/cached-copy /home/deployer/apps/mcash/releases/20120417074244 && (echo 8f69f0a524dcecef478bad74df4a983d3cdad480 > /home/deployer/apps/mcash/releases/20120417074244/REVISION)'" on 100.116.4.74
Here is entire deploy.rb file-
require "bundler/capistrano"
role :web, "200.116.4.75"
role :app, "200.116.4.75"
role :db, "200.116.4.75", :primary => true
set :application, "mcasher"
set :user, "deployer"
set :deploy_to, "/home/#{user}/apps/#{application}"
set :deploy_via, :remote_cache
set :use_sudo, false
set :scm, :git
set :repository, "git-server:mcasher.git"
set :branch, "master"
default_run_options[:pty] = true
ssh_options[:forward_agent] = true
after "deploy", "deploy:cleanup" # keep only the last 5 releases
namespace :deploy do
%w[start stop restart].each do |command|
desc "#{command} unicorn server"
task command, roles: :app, except: {no_release: true} do
run "/etc/init.d/unicorn_#{application} #{command}"
end
end
task :setup_config, roles: :app do
sudo "ln -nfs #{current_path}/config/nginx.conf /etc/nginx/sites-enabled/#{application}"
sudo "ln -nfs #{current_path}/config/unicorn_init.sh /etc/init.d/unicorn_#{application}"
run "mkdir -p #{shared_path}/config"
put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml"
puts "Now edit the config files in #{shared_path}."
end
after "deploy:setup", "deploy:setup_config"
task :symlink_config, roles: :app do
run "ln -nfs #{shared_path}/config/database.yml #{release_path}/config/database.yml"
end
after "deploy:finalize_update", "deploy:symlink_config"
desc "Make sure local git is in sync with remote."
task :check_revision, roles: :web do
unless `git rev-parse HEAD` == `git rev-parse origin/master`
puts "WARNING: HEAD is not the same as origin/master"
puts "Run `git push` to sync changes."
exit
end
end
before "deploy", "deploy:check_revision"
end

Resources