运行后,我正在使用 capistrano 进行部署
帽部署:冷
工作得很好。但如果我跑
帽部署
运行冷部署后
它抛出一个错误说
triggering after callbacks for `deploy:update_code'
* 2013-01-01 11:55:29 executing `deploy:assets:precompile'
* executing "cd /home/deployer/apps/poploda/releases/20130101105518 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
servers: ["192.34.56.129"]
[192.34.56.129] executing command
** [out :: 192.34.56.129] rake aborted!
** [out :: 192.34.56.129] Killed
** [out :: 192.34.56.129]
** [out :: 192.34.56.129] (in /home/deployer/apps/poploda/releases/20130101105518/app/assets/javascripts/application.js)
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:142:in `exec_runtime'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:28:in `block in exec'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:41:in `compile_to_tempfile'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/execjs-1.4.0/lib/execjs/external_runtime.rb:27:in `exec'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/uglifier-1.3.0/lib/uglifier.rb:100:in `compile'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/sprockets/compressors.rb:74:in `compress'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processing.rb:265:in `block in js_compressor='
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `call'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/processor.rb:29:in `evaluate'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/template.rb:76:in `render'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:193:in `block in evaluate'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `each'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/context.rb:190:in `evaluate'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/bundled_asset.rb:26:in `initialize'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `new'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:252:in `build_asset'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:93:in `block in build_asset'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/caching.rb:19:in `cache_asset'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:92:in `build_asset'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:169:in `find_asset'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/index.rb:60:in `find_asset'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/sprockets/static_compiler.rb:19:in `block in compile'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:219:in `block in each_logical_path'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:206:in `block (2 levels) in each_file'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:196:in `each_entry'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:204:in `block in each_file'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:203:in `each_file'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:217:in `each_logical_path'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/sprockets/static_compiler.rb:18:in `compile'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/sprockets/assets.rake:56:in `internal_precompile'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/sprockets/assets.rake:70:in `block (3 levels) in <top (required)>'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.
** [out :: 192.34.56.129] 9/lib/sprockets/assets.rake:60:in `block (3 levels) in <top (required)>'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/sprockets/assets.rake:23:in `invoke_or_reboot_rake_task'
** [out :: 192.34.56.129] /home/deployer/apps/poploda/shared/bundle/ruby/1.9.1/gems/actionpack-3.2.9/lib/sprockets/assets.rake:29:in `block (2 levels) in <top (required)>'
** [out :: 192.34.56.129] Tasks: TOP => assets:precompile:primary
** [out :: 192.34.56.129] (See full trace by running task with --trace)
command finished in 82944ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/deployer/apps/poploda/releases/20130101105518; true"
servers: ["192.34.56.129"]
[192.34.56.129] executing command
command finished in 2658ms
failed: "sh -c 'cd /home/deployer/apps/poploda/releases/20130101105518 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on 192.34.56.129
我的上限部署脚本是
set :whenever_command, "bundle exec whenever"
require "bundler/capistrano"
require "whenever/capistrano"
server "192.34.56.129", :web, :app, :db, primary: true
set :application, "poploda"
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@github.com:ramza1/#{application}.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"
run "mkdir -p #{shared_path}/config/environments"
put File.read("config/database.example.yml"), "#{shared_path}/config/database.yml"
put File.read("config/environments/production.example.rb"), "#{shared_path}/config/environments/production.rb"
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"
run "ln -nfs #{shared_path}/config/environments/production.rb #{release_path}/config/environments/production.rb"
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
任何帮助谢谢。