Issue
- gem 'dotenv-rails' is required in gemfile test and development environments.
- .env file is saved in root
- I believe variables use correct syntax; USERNAME=username
- I am using Rails 5.0.4
- I have not required 'dotenv-rails' anywhere, as the docs do not suggest that I need to.
When playing in the console, the only way I can access the variables is by calling, Dotenv.load in each session. Suggesting that Dotenv.load
should be called somewhere in config of my app.
Solution
Add Dotenv::Railtie.load
to your config/application.rb
Answered By - Lucas Moulin Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.