无法读取development.rb中的配置值

时间:2015-04-22 18:21:41

标签: ruby-on-rails ruby

我有这个:

beans.xml

出于某种原因,我在bean-discovery-mode="annotated"中收到# config/setting1.yml var1: 11 var2: 12 # config/initializers/setting1.rb Rails.configuration.setting1 = YAML.load_file(Rails.root.join('config', 'setting1.yml'))[Rails.env] # config/environments/development.rb //Doing something with Rails.configuration.setting1 // Rails.configuration.setting1['var1']

的错误

为什么?加载development.rb后是否加载development.rb?

1 个答案:

答案 0 :(得分:0)

config/environments/development.rb之后加载初始值设定项。您可以在Rails指南中查看更多内容:http://guides.rubyonrails.org/initialization.html