Heroku App Crash H10 - Bash: Bin/Rails: No Such File or Directory

Heroku App Crash H10 - bash: bin/rails: No such file or directory

I found a solution to the problem - it's quite simple:

heroku config:set PATH=bin:vendor/bundle/ruby/2.0.0/bin:/usr/local/bin:/usr/bin:/bin

I found the solution here: https://devcenter.heroku.com/articles/ruby-versions

Heroku deployment error H10 (App crashed)

I ran into the same error above, app was crashing on heroku (running fine in dev) but error logs on heroku were not revealing any clues. I read other answers on this page and broke out in a sweat after seeing "rebuilding the app." I figured maybe I could get in the heroku console and look around. I did and even the console crashed, but this time it told me why. It was some obscure variable I forgot to delete during a troubleshooting session hours earlier. I am not saying you will run into the same problem, but I found more info when I tried to go through the console. Hope this helps.

$ heroku run rails console

bin/rails: No such file or directory w/ Ruby 2 & Rails 4 on Heroku

After struggling with this for a bit, I noticed that my Rails 4 project had a /bin directory, unlike some older Rails 3 projects I had cloned. /bin contains 3 files, bundle, rails, and rake, but these weren't making it to Heroku because I had bin in my global .gitignore file.

This is a pretty common ignore rule if you work with Git and other languages (Java, etc.), so to fix this:

  1. Remove bin from ~/.gitignore
  2. Run bundle install
  3. Commit your
    changes with git add . and git commit -m "Add bin back"
  4. Push your changes to Heroku with git push heroku master

Heroku says Application Error and in the logs it say code=H10

As the log clearly says, the error is,

bash: bin/rails: No such file or directory

Looking at other StackOverflow answers, you might need to do,

rake rails:update:bin


Related Topics



Leave a reply



Submit