現象
[user@host]$ RAILS_ENV=production bundle exec rake solr:reindex
rake aborted!
NameError: uninitialized constant ApplicationController
....
原因
以前の投稿でproduction環境でthread safeの設定をしているため。
http://qiita.com/toshi_dev/items/c1e39666bda177e55c16
config/environments/production.rb
TestApplication::Application.configure do
...
config.threadsafe!
...
end
対処
条件をつけてThreadsafeで動かさないようにしてやる。
config/environments/production.rb
TestApplication::Application.configure do
...
config.threadsafe! unless ENV['THREADSAFE'] == 'off'
...
end
[user@host]$ RAILS_ENV=production THREADSAFE=off bundle exec rake solr:reindex
....