LoginSignup
23
19

More than 5 years have passed since last update.

Rails5 のproduction環境で lib/ 以下が読み込まれない問題

Last updated at Posted at 2016-10-21

Rails5 のproduction環境でlib/ 以下が読み込まれない問題

20160701180502.png

autoloadは、applicationに書いてるしなぁ

  • config.autoload_paths << Rails.root.join('lib')

しかもdevelopment では普通に呼ばれる

  • production環境でlib/以下が読み込めていないらしい

enable_dependency_loadingなるものがいるらしい

  • どうやら、config.enable_dependency_loading = true がいるらしい。
config/application.rb
config.enable_dependency_loading = true # <- これを追加しないといけないらしい
config.autoload_paths << Rails.root.join('lib')
23
19
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
23
19