【发布时间】:2012-02-08 22:44:09
【问题描述】:
我的应用似乎部署正确,但我收到此错误:
* executing "cd /home/deploy/tomahawk/releases/20120208222225 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile"
servers: ["ip_address"]
[ip_address] executing command
*** [err :: ip_address] /opt/ruby/bin/ruby /opt/ruby/bin/rake assets:precompile:nondigest RAILS_ENV=production RAILS_GROUPS=assets
我在这里尝试了尝试编译资产的解决方案:http://lassebunk.dk/2011/09/03/getting-your-assets-to-work-when-upgrading-to-rails-3-1/
这里:http://railsmonkey.net/2011/08/deploying-rails-3-1-applications-with-capistrano/
在这里:http://dev.af83.com/2011/09/30/capistrano-rails-3-1-assets-can-be-tricky.html
这是我的 deploy.rb :
require "bundler/capistrano"
load 'deploy/assets'
set :default_environment, {
'PATH' => "/opt/ruby/bin/:$PATH"
}
set :application, "tomahawk"
set :repository, "repo_goes_here"
set :deploy_to, "/home/deploy/#{application}"
set :rails_env, 'production'
set :branch, "master"
set :scm, :git
set :user, "deploy"
set :runner, "deploy"
set :use_sudo, true
role :web, "my_ip"
role :app, "my_ip"
role :db, "my_ip", :primary => true
set :normalize_asset_timestamps, false
after "deploy", "deploy:cleanup"
namespace :deploy do
desc "Restarting mod_rails with restart.txt"
task :restart, :roles => :app, :except => { :no_release => true } do
run "touch #{current_path}/tmp/restart.txt"
end
[:start, :stop].each do |t|
desc "#{t} task is a no-op with mod_rails"
task t, :roles => :domain do ; end
end
end
task :after_update_code do
run "ln -nfs #{deploy_to}/shared/config/database.yml #{release_path}/config/database.yml"
end
【问题讨论】:
-
我在部署我的 rails 3.1 应用程序时完全一样。我认为这隐藏在某处的sprockets rake task 中,但我没有看到。会不会是
precompile:assets:nondigest任务向 stderr 或其他东西记录了警告,而这是被 capistrano 拾取的? -
老实说,这个非摘要的东西有点超出我的理解范围(我仍然在预编译:) - 但我把这个给朋友看了,他说......“我认为这些根本不是错误我认为输出以某种方式搞砸了,认为它是一个错误流,当它使用正常输出时,只要部署完成你应该没问题,真正的错误会停止执行
标签: deployment ruby-on-rails-3.1 capistrano