I have a cron job that is a Ruby script. The problem is that the ruby
executable is different than expected. Ruby was installed from source so it should be the new global default.
$ ssh root@example.com
root@example.com$ ruby -v
ruby 2.0.0p247 (2013-06-27 revision 41674) [x86_64-linux]
root@example.com$ which ruby
/usr/local/bin/ruby
I currently have my script displaying the current user, ruby path, and ruby version:
# whoami
root
# which ruby
/usr/bin/ruby
# ruby -v
ruby 1.8.7 (2011-06-30 patchlevel 352) [x86_64-linux]
How do I correct this problem?
Update: The top of the first Ruby file that is executed has this line:
#!/usr/bin/env ruby