0
0

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 3 years have passed since last update.

railsで.envの値を読み込めなかったときにやること

Posted at

結論

spring stopを実行して、もう一度rails cでコンソールを立ち上げるとOK

$ spring stop
$ rails c

問題が起きた時の状態

.envファイル

.env
AUTH0_DOMAIN=https://XXXXXXXXXXXXX/
AUTH0_IDENTIFIER=https://XXXXXXXXXXXXXXX
$ rails c
Running via Spring preloader in process 19140
Loading development environment (Rails 6.0.4)
irb(main):001:0>  ENV['AUTH0_DOMAIN']
=> nil

spring stopを実行

$ spring stop
$ rails c
Running via Spring preloader in process 19270
Loading development environment (Rails 6.0.4)
irb(main):001:0> ENV["AUTH0_IDENTIFIER"]
=> "https://XXXXXXXXXXXXXXX"

ちゃんと読み込めた

0
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?