It is always a better idea for configuration variables to stay on the server as environment variables instead of putting them on your repository. It makes it less likely for someone to have access to them. Here are a few ways to set environment variables for your Rails application.
This is the simplest and most obvious of the 3. It is default way you are going to do it. Just add the environment variables in your
export APPLICATION="Application Name" export APPLICATION_VERSION="Application Version"
dotenv is a Ruby gem to load environment variables from an
gem 'dotenv-rails', groups: [:development, :test]
And then execute:
Figaro is a nice gem that simplifies configuration files.
You might need to add the additional
yml file to .gitignore.
application_conf: "882354" application_key: "fausdhf7(0sadfsmd__nfasdf" some_conf: "23456789hdsfdsfasdf132"
These can be used throughout the application via