LoginSignup
0
0

More than 1 year has passed since last update.

本番環境(heroku)に環境変数を設定し忘れた結果

Posted at

Heroku上に環境変数を設定するのを忘れていたため
エラーが起きてしまいました。

herokuにログインして以下のコマンドを実行です。

(ターミナル)
heroku config:set PAYJP_SECRET_KEY=‘sk_test_**********
heroku config:set PAYJP_PUBLIC_KEY=‘pk_test_
**********’

次にheroku configで環境変数が設定できたか確認します。

(ターミナル)
PAYJP_PUBLIC_KEY: pk_test_*************
PAYJP_SECRET_KEY: sk_test_*************

最後にgit push heroku masterで終了の予定でした。
しかし、まだエラーは続いています。

どうやらエラー原因は、環境変数を設定する前に
git push heroku masterしてしまったからなようです。

環境変数を設定し直して再度
git push heroku masterしてみました。

結果は、Everything up-to-date
とターミナル上に表示されるだけ。
変更が反映されないのです。

そんな時は以下のコマンドを実行です。
git commit --allow-empty -m “空のcommit”

すると空のcommitを作ることができます。

最後にherokuにプッシュします。
git push heroku master

これでダメならお手上げの状態でしたが
何とかアプリが正常に動いてくれました。

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