#現象
railstutorial2章、Microposts作成時
herokuにpushしようとしたところ(git push heroku master)エラーが発生した。
【エラー内容】
To ssh://heroku.com/pure-shelf-xxxxx.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'ssh://git@heroku.com/pure-shelf-xxxxx.git'
ログを見ると下記のエラーが発生していた。
NoMethodError: undefined method `web_console'
#原因
このエラーは、Gemパッケージweb_consoleに関する設定を config/application.rb ファイルや config/initializers ディレクトリ内のファイルなどに記述すると発生します。
→ config.web_console.whitelisted_ips = ''
どこかでwebconsoleの設定をしてしまっていた
#解決方法
config/application.rbから
config.web_console.whitelisted_ips = ''
の記述を削除
#結果
git push heroku master再実行→pushが成功した
#参考
https://www.oiax.jp/books/rails4book/undefined_method_web_console.html