Heroku で bin/rails: No such file or directory

こんな事にハマる人はどこにも居ないと思うが、いつかの自分の為に。

結論

  • ~/.gitignore に /bin/ の記載があり、/bin 以下のファイルがheroku に push されていなかった

HerokuでRailsを起動したら

Application error
An error occurred in the application and your page could not be served. If you are the application owner, check your logs for details.

Heroku のログを見る

$ heroku logs -t 

2017-02-04T06:51:56.618341+00:00 heroku[web.1]: State changed from crashed to starting
2017-02-04T06:51:58.524827+00:00 heroku[web.1]: Starting process with command `bin/rails server -p 29792 -e production`
2017-02-04T06:52:00.050294+00:00 app[web.1]: bash: bin/rails: No such file or directory
2017-02-04T06:52:00.122536+00:00 heroku[web.1]: State changed from starting to crashed
2017-02-04T06:52:00.116558+00:00 heroku[web.1]: Process exited with status 127

bin/rails がないようだ

なぜか.gitignore に /bin/ の記載が。。。

  • コメントには Intelli J と書いてある。
  • global にしたい気持ちはわかるが、今後はプロジェクトの.gitignore に書くようにする

気を取り直して、再度 heroku push まで

bundle install
git commit -am "xxx"
git push heroku master

雑感

さくっとrails を使おうと思ったら、まさかこんな所で。