On my server I have one cronjob for running ruby script through rake, but the script is not executed. I'm running rvm with 2.1.2 ruby and here is my crontab:
SHELL=/bin/bash
PATH=/home/deployer/.rvm/gems/ruby-2.1.2/bin:/home/deployer/.rvm/gems/ruby- 2.1.2@global/bin:/home/deployer/.rvm/rubies/ruby-2.1.2/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/deployer/.rvm/bin:/home/deployer/.rvm/bin
*/1 * * * * cd /var/www/cars_crawler && /home/deployer/.rvm/gems/ruby-2.1.2/bin/rake >> /var/www/cars_crawler/cron.txt 2>&1
The error from cronjob is:
/home/deployer/.rvm/rubies/ruby-2.1.2/bin/ruby get_cars.rb
/home/deployer/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- nokogiri (LoadError)
When I run manually the rake command, not through crontab everything is ok, but from cronjob the problem is present. What I noticed is this line: /home/deployer/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/
I don't have ruby 2.1.0 installed. What can cause this problem, I'm out of ideas