【问题标题】:sinatra file_config gem not working in stagingsinatra file_config gem 无法暂存
【发布时间】:2013-01-09 17:25:09
【问题描述】:

我正在使用this gem 它适用于生产环境和开发,但不能暂存:

这里是main.rb

set :environments, %w{development test production staging}
config_file 'config/config.yml'

和 config/config.yml

development: &development
  sub1:
    pay_to_email: test1@gmail.com

test:
  <<: *development

staging:
  <<: *development  

production:
  <<: *development

【问题讨论】:

    标签: sinatra yaml configuration-files


    【解决方案1】:

    弄清楚为什么我必须在注册 Sinatra::ConfigFile 之后设置它 像这样:

     register Sinatra::ConfigFile   
     set :environments, %w{development test production staging}
     config_file 'config/config.yml'
    

    【讨论】:

    • 很高兴您找到并回答,感谢您回来回答您自己的问题,尤其是当它是您的第一个问题时。 +1。
    猜你喜欢
    • 2011-11-10
    • 1970-01-01
    • 1970-01-01
    • 2017-10-26
    • 2013-01-10
    • 1970-01-01
    • 2011-05-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多