3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

dotenv-railsについて

Last updated at Posted at 2016-07-16

dotenv-rails

このGemを使うと、アプリケーションごとに環境変数(非公開情報)が設定できるようになり、 secrets.ymlに公開したくない情報を設定しなくても良くなります。herokuではsecrets.ymlが必要なので、.gitignoreするわけにはいかない。

/.env
TWITTER_API_KEY="hogehoge"
TWITTER_API_SECRET="fugafuga"

・config/secrets.ymlとは環境変数を設定するファイル
環境変数"SECRET_KEY_BASE"に書こうよってなってる。

参考サイト
http://blog.10rane.com/2015/05/13/dotenv-manages-secret-of-rails4/

gem configは下記
http://qiita.com/yumiyon/items/32c6afb5e2e5b7ff369e

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?