我正在使用 ActiveAdmin,capistrano 进行部署,thinkng_sphinx 进行搜索,delayed_job 在添加新记录后自动为 ts 运行 reindex。
我的 deploy.rb 的一部分
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
我试图将 app/admin/users.rb 重命名为 app/admin/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'
Thinking-sphinx (2.0.12) ts-delayed-delta (1.1.2) delayed_job (3.0.3) delayed_job_active_record (0.3.2) activeadmin (0.4.4)