after callbacks for `deploy:update_code' not triggered

696 views
Skip to first unread message

javinto

unread,
Feb 2, 2012, 3:27:35 PM2/2/12
to Capistrano
Hi!

Before I ran into problems with my repository and updated to Rails
3.2.x deployment went great!

But now I get:
triggering after callbacks for `deploy:update_code'
* executing `deploy:assets:precompile'
* executing "cd ~/rails/releases/20120202201540 && bundle exec rake
RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
servers: ["server"]
[server] executing command
*** [err :: server] rake aborted!
*** [err :: server No such file or directory - /var/www/vhosts/
v2.zorgverband.nl/rails/releases/20120202201540/config/database.yml

The problem is that the symlink to /shared/config/database.yml is not
created. This is done like:

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
after 'deploy:update_code', :link_production_db
end

desc "[internal] Link database.yml from shared path"
task :link_production_db do
run "ln -nfs #{deploy_to}/#{shared_dir}/config/database.yml
#{release_path}/config/database.yml"
run "ln -nfs #{deploy_to}/#{shared_dir}/config/email.yml
#{release_path}/config/email.yml"
end

As you can see it triggers the precompile assets task first and skips
the :link_production_db task.

Reverting back to Rails 3.1.x did not help.

Any ideas?

I run Capistrano 2.9.0 on Ruby 1.9.3 on RVM.

javinto

unread,
Feb 3, 2012, 10:42:26 AM2/3/12
to Capistrano
I solved it myself.

In Capfile the line "load 'deploy/assets'" should be at the end of it.
It apparently became a problem with Rails 3.2 not being last in line.
Reply all
Reply to author
Forward
0 new messages