Last active
January 1, 2016 07:09
-
-
Save closer/8110235 to your computer and use it in GitHub Desktop.
環境によって変わる設定値はdotenvを使うと便利 ref: http://qiita.com/closer/items/f8d8ba00ae86d7051764
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .env | |
| AWS_ACCESS_KEY_ID="hogehoge" | |
| AWS_SECRET_ACCESS_KEY="mogamoga" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| puts ENV["AWS_ACCESS_KEY_ID"] # => nil | |
| Dotenv.load | |
| puts ENV["AWS_ACCESS_KEY_ID"] # => "hogehoge" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| gem 'dotenv-rails' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment