我已經制作了一個新的Rails 3.2應用程序。當我用Capistrano部署它時,編譯資產時出現錯誤。但是資產被編譯,並且應用程序被部署。對耙子資產的Capistrano錯誤:預編譯:所有但仍然工作(使用RVM)
在我安裝了RVM系統範圍,然後創建的服務器:
User: skolemapicture (added to group rvm)
Deploy folder: /home/skolemapicture/site
.rvmrc in /home/skolemapicture/site/.rvmrc
我deploy.rb配置看起來是這樣的(什麼都沒有做的問題,省略線)
set :application, "skolemapicture"
set :deploy_to , "/home/skolemapicture/site"
set :user , "skolemapicture"
set :use_sudo , false
ssh_options[:forward_agent] = true
require "bundler/capistrano"
require "rvm/capistrano"
set(:ruby_version) { '1.9.3' }
set(:rvm_ruby_string) { "#{ruby_version}@#{application}" }
set(:rvm_path) { "/usr/local/rvm" }
set(:rvm_type) { :system }
namespace :deploy do
task :precompile, :role => :app do
run "cd #{release_path}/ && bundle exec rake assets:precompile"
end
end
after "deploy:finalize_update", "deploy:precompile"
我在「cap deploy」時得到的錯誤是:
* 2013-02-13 10:36:21 executing `deploy:precompile'
* executing "cd /home/skolemapicture/site/releases/20130213093619/ && bundle exec rake assets:precompile"
servers: ["web01.mapicture.com"]
[web01.mapicture.com] executing command
*** [err :: web01.mapicture.com] /usr/local/rvm/rubies/ruby-1.9.3-p374/bin/ruby /home/skolemapicture/site/shared/bundle/ruby/1.9.1/bin/rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets
*** [err :: web01.mapicture.com]
但是資產被編譯。那麼爲什麼這個錯誤?
/卡斯滕
任何你不使用Capistrano的內置'deploy/assets'任務的原因,包括一個'deploy:precompile'任務,它基本上和你的任務一樣嗎? – 2013-03-04 07:04:55