我的應用程序似乎被正確部署,但我得到這個錯誤:Capistrano編譯資產錯誤 - 資產:預編譯:nondigest?
* 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應用程序時,我完全一樣。我認爲這是隱藏在[sprocket rake任務](https://github.com/rails/rails/blob/master/actionpack/lib/sprockets/assets.rake)的地方,但我沒有看到它。難道預編譯:assets:nondigest'任務會向stderr或其他東西發出警告,這是capistrano拾取的嗎? – HectorMalot 2012-02-09 10:52:07
爲了說實話,這個非消化的東西有點超出了我的理解範圍(仍然包裹着預編譯的頭部:) - 但是我向一位朋友展示了這一點,他說這個......「我不認爲這些錯誤在所有 我認爲輸出結果搞砸了,認爲它的錯誤流,當它使用正常的輸出,只要部署完成你應該罰款,一個真正的錯誤停止執行 – fatfrog 2012-02-09 16:28:02