1
我使用ActiveAdmin,capistrano進行部署,thinkng_sphinx進行搜索,delayed_job在添加新記錄後自動爲ts運行reindex。從我deploy.rb在Capistrano部署期間延遲作業失敗
部分
before 'deploy:update_code', 'thinking_sphinx:stop'
after 'deploy:update', 'thinking_sphinx:index', 'thinking_sphinx:start'
after 'deploy:finalize_update', 'sphinx:symlink_indexes', "delayed_job:stop", "delayed_job:start"
問題是運行此命令時期間部署
executing "RAILS_ENV=production /.../current/script/delayed_job stop"
我
/.../shared/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:503:in `load_missing_constant'
Expected /.../releases/20120804075838/app/admin/users.rb to define Users (LoadError)
from /.../shared/bundle/ruby/1.9.1/gems/activesupport-3.2.6/lib/active_support/dependencies.rb:192:in `block in const_missing'
...
這裏是app/admin/users.rb
ActiveAdmin.register ::User do
index do
column :name
column "E-mail", :email
end
end
我試圖重新命名的應用程序/管理/ users.rb的到應用程序/管理/ user.rb - 沒有
但是,如果我從服務器命令行直接運行:
RAILS_ENV=production script/delayed_job stop
所有正常工作
從我的Gemfile
gem 'delayed_job'
gem 'delayed_job_active_record'
gem 'daemons'
gem 'thinking-sphinx'
gem 'ts-delayed-delta', :require => 'thinking_sphinx/deltas/delayed_delta'
思維 - 獅身人面像(2.0.12) TS-延遲-Δ(1.1.2) 的delayed_job(3.0.3) delayed_job_active_record(0.3.2) activeadmin(0.4.4)
是啊,問題是在我的 「開始」 任務定義。 正如你所提到的'運行'cd#{current_path};腳本/ delayed_job - 運行'#{current_path} /腳本/ delayed_job -e#{rails_env}啓動''而不是cd到應用程序目錄並運行腳本之後, e#{rails_env}開始「' – 2012-09-07 18:34:45