I\'m getting this error whenever I run rails
(or any rails command)
_rails_command:2: permission denied: bin/rails
ONLY when i\'m inside some
So what worked for me, anyone coming across this issue is to run
bundle exec rake app:update:bin
You'll be given a prompt asking if you want to overwrite? The options here are:
I chose a and it seemed to work ok.
The solution for me was:
bundle exec rake rails:update:bin
or just use:
For new rails versions:
bundle exec rake app:update:bin
For old rails versions:
bundle exec rake rails:update:bin
I have this when I try to use a rails 4.0 version.
So when I try to put bundle exec
first, like:
bundle exec rake db:migrate
or
bundle exec rails s
work's.
Run
bundle exec rake rails:update:bin
It will update bin/rails and bin/rake files.
In the directory you mentioned is your rails in executable mode. If not you can apply
chmod u+x bin/rails
and make it executable.
I had the same issue and here's what helped me. Open ~/.zshrc and add this
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"