application.yml:
defaults: &defaults
files:
host: '192.168.1.1'
port: '8080'
development:
<<: *defaults
production:
files:
host: '192.168.1.1'
port: '8080'
settings.rb:
class Settings < Settingslogic
source "#{Rails.root}/config/application.yml"
namespace Rails.env
end
application.rb:
FILE=Settings.fles
application.rb 会报错:
Uncaught exception: uninitialized constant Settings