I’ve installed rvm + ruby systemwide.
which ruby
/usr/local/rvm/rubies/ruby-2.1.1/bin/ruby
and:
/usr/bin/env: ruby: No such file or directory
Everything else works fine, putting direct path of ruby in my executables work fine.
The PATH is what the env program uses to search for your executables. You can change this per-user (in the $HOME/.bashrc). In order to do that, run nano $HOME/.bashrc and go to the last line, add a new line
export PATH=$PATH:/usr/local/rvm/rubies/ruby-2.1.1/bin
To change it at a system level you sudo nano /etc/login.defs and change this line
ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games
to :
ENV_PATH PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/usr/local/rvm/rubies/ruby-2.1.1/bin
If you set your $PATH var to use the wrapper directory associated with the Ruby version you want to use e.g.