bash: /usr/local/bin/heroku: /usr/local/bin/ruby: bad interpreter: No such file or directory
Make sure the first line of the file /usr/local/bin/heroku
is #!/path/to/ruby
. You may need to change it from /usr/local/bin/ruby
to /usr/bin/ruby
, or if you cannot find the ruby
executable, type which ruby
or updatedb && locate ruby
to find it.
If the above doesn't work...
Check your ~/.bashrc
, ~/.inputrc~
, /etc/bashrc
, /etc/inputrc
, /etc/profile
for a line trying to execute /usr/local/bin/heroku
.
Another idea is you might have this as one of your startup programs. Check in /etc/inittab
for a line with /usr/local/bin/heroku
.
If you still cannot find that line in any of those files you can run grep -iH heroku /*
Can't install Rails on El Capitan
As per your suggestions to look in those other questions and after some more digging, I ended up limiting the error to Not a directory
which led me to an rbenv
issue that pointed me to the possibility of having /usr/local/bin
at the head of my PATH after initializing rbenv. And, as jeremy writes, that's why invoking rails is finding the executable in /usr/local/bin/
instead of in /Users/michelfrechette/.rbenv/shims/
. So I removed that line and problem solved!
Ruby on Rails: heroku database push
Heroku can't find Ruby. This is common if you're using RVM or something to manage your Ruby installations. How did you install Heroku, and how did you install Ruby?
Related Topics
Getting a Rogue Iteration from My .Each Loop
Undefined Method Error When Creating Delayed_Job Workers with Script/Delay_Job
Ruby Dynamically Naming Arrays
Ruby 1.8: Hash#Sort Not Return Hash But Array (Better Way to Do This)
Loop Within Loop in Rails Controller
Return True Only If All Values Evaluate to True in Ruby
Rescuing "Command Not Found" for Io::Popen
Why Rails Can Use 'If' as Hash Key But Not in Ruby
Rails Syntax Error: Unexpected Keyword_Ensure, Expecting Keyword_End
Hardcoded "Require 'Debug'" Can't Find the Sourcefile
Config Undefined in Environment Specific Configuration Files
Undefined Method 'Email' for Nil:Nilclass in Exibe the Mail of Table Father
Initialize the Delayed Jobs Gem by Starting the Workers on Application Start
Ruby Daemon Process to Keep Objects Alive for Transient Ruby Instances
Rubocop, How to Disable/Enable Cops on Blocks of Code
How to Force To_Yaml to Output Long Strings in Literal Block Style