3

我正在部署我的Rails 3.2.2,Ruby 1.9.3應用程序與Capistrano到Linux服務器。當我運行一個cap deploy我得到這個錯誤:Capistrano部署,資產管道,ruby調試沒有找到

* executing `deploy:assets:precompile' 
    * executing "cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile" 
    servers: ["example.com"] 
    [example.com] executing command 
    [example.com] sh -c 'cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile' 
** [out :: example.com] rake aborted! 
** [out :: example.com] cannot load such file -- ruby-debug 
** [out :: example.com] 
** [out :: example.com] (See full trace by running task with --trace) 
    command finished in 8962ms 
*** [deploy:update_code] rolling back 
    * executing "rm -rf /var/www/production/releases/20120418090209; true" 
    servers: ["example.com"] 
    [example.com] executing command 
    [example.com] sh -c 'rm -rf /var/www/production/releases/20120418090209; true' 
    command finished in 176ms 
failed: "sh -c 'cd /var/www/production/releases/20120418090209 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile'" on example.com 

它說,該ruby-debug寶石沒有被發現。但是Ruby調試是不是製作組在我的Gemfile裏:

group :development, :test do 
    gem "steak" 
    gem "linecache19", :git => "git://github.com/mark-moseley/linecache", :require => "ruby-debug" 
    gem "ruby-debug-base19x", "~> 0.11.30.pre4" 
    gem "ruby-debug19" 
    gem "rails_best_practices" 
    gem "ruby_parser" 
    gem "reek" 
    gem "flog" 
    gem "jslint_on_rails", :git => "git://github.com/psionides/jslint_on_rails" 
    gem "jasmine-rails" 
end 

導致錯誤獲取rake assets:precompile命令後拋出,我認爲它有一些待辦事項與Capistrano的和load 'deploy/assets'叫我Capfile內:

load 'deploy' if respond_to?(:namespace) # cap2 differentiator 
Dir['config/deploy/recipes/*.rb','vendor/gems/*/recipes/*.rb','vendor/plugins/*/recipes/*.rb'].each { |plugin| load(plugin) } 
load 'config/deploy' # remove this line to skip loading any of the default tasks 
# Uncomment if you are using Rails' asset pipeline 
load 'deploy/assets' 

當我刪除這條線時,一切正常部署,但(當然)資產沒有在生產中找到。而且,如果我直接在服務器上運行bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile(在應用程序目錄中),我會得到相同的錯誤。

那我該怎麼辦?

回答

相關問題