Tôi đi theo nhận xét chủ trương trong config/application.rb đó làRails 5 Beta: Đặt eager_load_paths cấu hình trên initializer ném mảng đông lạnh ngoại lệ
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
Nhưng khi tôi thêm Rails.application.config.eager_load_paths << Rails.root.join('lib')
trong config/initializers/eager_load.rb
.
Nó ném <top (required)>': can't modify frozen Array (RuntimeError)
Có nó đang làm việc nếu tôi đặt nó bên config/application.rb
.
Tôi muốn biết tại sao nó không hoạt động trên bộ khởi tạo và cách làm cho nó hoạt động bằng cách sử dụng quy ước?