Configus helps you easily manage environment specific settings
Add this to your Gemfile:
gem "configus"
Configus.build:developmentdo# set current environmentenv:productiondosite_name'Example'webdodomain'example.com'protocol'https'port80uri->{"#{protocol}://#{domain}:#{port}"}endsite_uri->{web.uri}emaildopopdoaddress'pop.example.com'port110endsmtpdoaddress'smtp.example.com'port25endendendenv:development,:parent=>:productiondowebdodomain'localhost'protocol'http'port9292endemaildosmtpdoaddress'smpt.text.example.com'endendendendconfigus.site_name # => 'Example'
configus.web.uri # => 'https://example.com:80'
configus.site_uri # => 'https://example.com:80'
configus.email.pop.port # => 110
define your config in lib/configus.rb
Configus.build Rails.env do
# settings
end
reload
# config/environments/development.rb
ActionDispatch::Reloader.to_prepare do
load Rails.root.join('lib/configus.rb')
end