I’m trying to deploy my Rails application using Capistrano.
My deploy.rb file looks like this :
require "bundler/capistrano"
server "xx.xx.xxx.xxx", :web, :db, :primary => true
set :application, "myApp"
set :user, "ubuntu"
set :deploy_to, "/home/#{user}/apps/#{application}"
#set :deploy_via, :remote_cache
set :migrate_target, :current
set :keep_releases, 3
set :scm, "git"
set :repository, "git@github.com:name/#{application}.git"
set :branch, "master"
set :use_sudo, false
default_run_options[:pty] = true
# default_run_options[:shell] = '/bin/bash'
ssh_options[:forward_agent] = true
ssh_options[:keys] = ["#{ENV['HOME']}/.ec2/keypair.pem"]
Now whenever I try to do
cap deploy:cold
I get an error just like the following :
https://gist.github.com/c54933142b900f9f93b9
Any help would be appreciated .
The only thing I am looking at that I don’t recognize is the
set :migrate_target :current— this is probably the default or implied so maybe nothing to worry about, but the root error from your gist iscurrentshould be a symbolic link, not a directory, so it’s hard to know how it got to be directory.I would log in to the server, change to
/home/ubuntu/apps/myApp/thenrm -rf current. From there you could manually create the expected symlink (current will link to a directory whose name is a date/time), or alternatively back from your local machine runcap deploy:create_symlinkthen try a regular deploy.I think it’s fair to say that capistrano initialization is not it’s strong suit — once you get things going it tend to be ridiculously awesome, until then, more just infuriatingly obtuse.