0
有配置在aws_setting.yml針對不同的環境,如:Heroku的環境變量不可訪問,而不是獲取<%= ENV [ 'MY_Setting']%>
local: &local_settings
enable_setting: true
heroku: &heroku_settings
enable_setting: <%= ENV['MY_SETTING'] %>
test:
<<: *local_settings
development:
<<: *local_settings
staging:
<<: *heroku_settings
在Heroku的加入MY_SETTING KVP在分期的配置瓦爾
加載小號ettings初始化期間:
S3_SETTING = YAML.load_file("#{::Rails.root}/config/aws_setting.yml")[Rails.env]
現在部署分期,而不是得到爲S3_Setting['enable_setting']
值作爲true
或false
,接收 '[MY_SETTING'] = ENV <% '%>' 作爲文本之後。