Rubymine: Cannot commit due to '/usr/bin/env: ‘ruby’: No such file or directory'
Hello,
I have a fairly standard setup on my Linux machine yet cannot commit. When I try to, I get:
xx:xx Commit failed with error
0 files committed, 1 file failed to commit: XXXXXXXXXXXXXXXXXXXXXXXXX
/usr/bin/env: ‘ruby’: No such file or directory
I have a fairly standard setup. I have rbenv in ~/.rbenv , set up via ~/.bashrc. The app is a standard Ruby Sinatra app. When I create the project, it successfully picks up the rbenv Ruby version and sets that as the project's Ruby.
I can't seem to see any other issues. For example, I can import and run Rake tasks just fine.
Anyone know what the hell is going on?
Thanks
Please sign in to leave a comment.
Hello,
I just discovered what the reason was. Even though I have rbenv-installed Ruby versions active, IDEA requires that I have a Ruby version installed in a system location! This is probably because I'm launching it from the GUI launcher, which does not load up my '~/.bashrc' file, and thus does not set up rbenv. So the follow up question is: is there a way to add some initialization to the IDEA editor launcher so I can load up rbenv in it's environment?
Thanks
rbenv is designed to run from shell, so the environment is not avaiolable to apps started from GUI. You can start RubyMine from terminal to get environment loaded
Thank you! This happened to me on Linux CentOS, I installed Ruby and was solved, didn't understand quite well, but it worked!