1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

rakeタスクがproduction環境でNameErrorになる

1
Last updated at Posted at 2015-07-15

現象

[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
....

参照

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?