2012-11-12 132 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