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:
- Remove
bin
from~/.gitignore
- Run
bundle install
- Commit your
changes withgit add .
andgit commit -m "Add bin back"
- 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
How to Make a Post Request with Open-Uri
Query Records Through Its Belongs_To Relation in Rails
How to Get Indexes of All Occurrences of a Pattern in a String
How to Get the Last SQL Query Performed by Activerecord in Ruby on Rails
Array of Indexes to Array of Ranges
Has Anyone Successfully Deployed a Rails Project with Ruby 1.9.1
Show Full Path Name of the Ruby File When It Get Loaded
Howto Rank Items by Balance in Ruby on Rails
How to Use Params with Slashes with Sinatra
What Do I Need to Do to Get the Blog to Work in Rails 4.2
Complicated Graphviz Tree Structure
Using Rbenv Doesn't Work with Sudo