So I was making a cgi ruby script and had the following at the top of the script file:
#!/usr/bin/env ruby
require 'rubygems'
require 'action_pack'
require 'cgi'
After a couple of hours of not getting "/usr/bin/env: ruby: No such file or directory" error and google searching, I uninstalled my system ruby 1.8.7 (I also had 1.9.3 installed via rvm) by doing sudo apt-get purge ruby rubygems. I still get the error. When I type "which ruby", I get /home/homeuser/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
. Does anyone have any insight as to how to fix this problem?
Here is what echo $PATH yields:
/home/homeuser/.rvm/gems/ruby-1.9.3-p194@rsoc326/bin:/home/homeuser/.rvm/gems/ruby-1.9.3-p194@global/bin:/home/homeuser/.rvm/rubies/ruby-1.9.3-p194/bin:/home/homeuser/.rvm/bin:/var/lib/gems/1.8/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/home/homeuser/.rvm/bin
I have this same setup on my desktop and I don't have the same issue.