Sign up for Prelang to use this feature.
Prelang automates the process of installing Dotenv, an environment variable management gem for Ruby on Rails. This guide will explain how to install Dotenv and use it after your application generates.
- Find and add the Environment Variables feature
- Generate your application
This will add and configure the Dotenv Rails gem.
Once you have your application up and running locally on your development environment, make a new file in your application's directory named
.env. Here, you can put sensitive environment variables as so:
Your environment variables will now be accessible from anywhere in your Rails application. Use them with
ENV like this:
Usually, these are use in initializers at
Automatic Rails Development Tools