RailsConfig gem在开发环境中无法正常工作

时间:2018-10-18 21:25:57

标签: ruby-on-rails ruby-on-rails-3 rubygems config rails-spring

我具有以下设置:

app_dir / config / settings / development.yml dev_setting_1: "hello_dev"

app_dir / config / settings / production.yml prod_setting_1: "hello_prod"

app_dir / config / settings.yml gen_setting_1: "hello_world"

app_dir / config / settings.local.yml local_setting_1: "hello_local"

当我运行生产环境

DISABLE_SPRING=true rails c production

Settings.reload!

Settings.keys

我得到了预期的结果:

[:local_setting_1:, gen_setting_1, :prod_setting_1]

如何

当我运行开发环境DISABLE_SPRING=true rails c development

Settings.reload!

Settings.keys

我只获得.local.yml文件的密钥 [:local_setting_1]

我会期望的

[:local_setting_1:, gen_setting_1, :dev_setting_1]

任何想法都会受到赞赏

我正在Mac上运行Rails 5.0.6

0 个答案:

没有答案