sinatra file_config gem不能在staging中工作

时间:2013-01-09 17:25:10

标签: sinatra yaml config-files

我正在使用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

1 个答案:

答案 0 :(得分:5)

想出为什么我必须在寄存器Sinatra :: ConfigFile之后设置它 像这样:

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