I’m using ActiveAdmin, capistrano to deploy, thinkng_sphinx to search and delayed_job to automatically run reindex for ts after adding new record.
Part from my 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"
The problem is when running this command during deploy
executing "RAILS_ENV=production /.../current/script/delayed_job stop"
I got
/.../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'
…
Here is app/admin/users.rb
ActiveAdmin.register ::User do
index do
column :name
column "E-mail", :email
end
end
I tried to rename app/admin/users.rb to app/admin/user.rb – nothing
But if I run just from server command line:
RAILS_ENV=production script/delayed_job stop
all works fine
From my 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)
Try this in your deploy.rb.
delayed recipes uses rails_env variable