Rake资产出错:预编译

时间:2012-11-12 06:37:43

标签: rake ruby-on-rails-3.2 capistrano asset-pipeline

我正在尝试在带有Capistrano的服务器上部署我的应用程序。 我运行了deploy:setup和deploy:检查成功。

部署的一些任务:更新成功通过,但 deploy:asset:precompile 任务似乎崩溃了ruby。

我试图了解错误的原因:  该问题似乎与 Rails Asset Pipeline postgresql_adapter 相关联。

我有点迷失,因为我对资产管道不太了解。我知道的最少的是Asset Pipeline与javascript和CSS样式表有关,所以我不明白postgresql_adapter在这里做了什么?

这些是我的(服务器和工作站)版本:

  • Rails 3.2.8
  • RVM 1.16.17
  • 宝石1.8.24
  • Bundler 1.2.1
  • pg gem 0.14.1

我还尝试在服务器上运行commande bundle exec rake assets:precompile ,结果是一样的。因此问题与此命令有关。

这是我收到的错误摘要:

  * 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]

在任何情况下,这都是我的config / deploy.rb:

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

set :rvm_type, :system

set :rvm_ruby_string, 'ruby-1.9.3-p194@rail3dev20120606'
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,  'git@github.com: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

非常欢迎帮助,因为我不知道在哪里看。 感谢

1 个答案:

答案 0 :(得分: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