2012-11-12 230 views
0

我試圖在Capistrano上的服務器上部署我的應用程序。 我運行了deploy:setup和deploy:檢查成功。Rake資產出錯:預編譯

部分任務部署:更新成功通過,但部署:資產:預編譯任務似乎崩潰紅寶石。

我試着去了解錯誤的原因: 看來,這個問題是與滑軌資產管道postgresql_adapter

我有點失落,因爲我對資產管道的瞭解不多。我知道的最少的是Asset Pipeline必須處理javascript和CSS樣式表,所以我不明白postgresql_adapter在這裏做了什麼?

這些是我的(服務器和工作站)版本:

  • 的Rails 3.2.8
  • RVM 17年1月16日
  • 寶石1.8.24
  • 捆紮機1.2.1
  • 皮克寶石0.14.1

我也試過運行commande bun dle exec rake assets:在服務器上預編譯,結果是一樣的。所以問題與這個命令有關。

這是我得到了錯誤的摘要:

* 2012-11-09 16:54:21 executing `deploy:assets:precompile' 
    * executing "cd /var/www/opf/releases/20121109155419 && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile" 
    servers: ["192.168.5.200"] 
    [192.168.5.200] executing command 
** [out :: 192.168.5.200] /var/www/opf/shared/bundle/ruby/1.9.1/gems/activerecord-3.2.8/lib/active_record/connection_adapters/postgresql_adapter.rb:1213: [BUG] Segmentation fault 
** [out :: 192.168.5.200] ruby 1.9.3p194 (2012-04-20 revision 35410) [x86_64-linux] 

這是在任何情況下我的配置/ deploy.rb:

require 'bundler/capistrano' 
require File.join(File.dirname(__FILE__), 'deploy') + '/capistrano_database' 

set :rvm_type, :system 

set :rvm_ruby_string, '[email protected]' 
require 'rvm/capistrano' 

set :application, 'opf' 
set :deploy_to, '/var/www/opf' 
set :rails_env, 'production' 
set :user, 'the_user' 
set :use_sudo, false 

set :group_writable, false 
set :scm, :git 
set :repository, '[email protected]:user/opf.git' 
set :branch, 'master' 

default_run_options[:pty] = true 

set :deploy_via, :remote_cache 

server '192.168.5.200', :web, :app, :db, :primary => true 

# If you are using Passenger mod_rails uncomment this: 
namespace :deploy do 
    task :start do ; end 
    task :stop do ; end 
    task :restart, :roles => :app, :except => { :no_release => true } do 
    run "#{try_sudo} touch #{File.join(current_path,'tmp','restart.txt')}" 
    end 
end 

幫助真的是歡迎的,因爲我不知道在哪裏看。 謝謝

回答

0

我最終找到了解決方案!

首先知道,顯示該PhusionPassenger是埃羅消息:

Passenger encountered the following error: 
The application spawner server exited unexpectedly: Unexpected end-of-file detected. 

Exception class: 
    PhusionPassenger::Rack::ApplicationSpawner::Error 

無關寶石,雖然它通常可以作爲解釋here的情況。

你可以找到我的解決方案here