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