"bin/rails: No such file or directory" w/ Ruby 2 & Rails 4 on Heroku
I had this problem also since I upgraded to rails 4.0.0
Run this command
rake rails:update:bin
You can go here for more info https://devcenter.heroku.com/articles/rails4
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 with
git add .
andgit commit -m "Add bin back"
- Push your changes to Heroku with
git push heroku master
Steps :
bundle config --delete bin
# Turn off Bundler's stub generator
rake rails:update:bin
# Use the new Rails 4 executables
git add bin or git add bin -f
# Add bin/ to source control
git commit -a -m "you commit message"
git push heroku master
heroku open