4

I have created the cron job with whenever (https://github.com/javan/whenever):

every 1.hours do
   rake "scrape" 
end

The rake scrape task runs fine when I run it manually, but when cron runs I get:

rake aborted!
Could not find table 'beskeds'

The command run is:

/bin/bash -l -c 'cd /Users/klaus/Documents/src/Ruby/rails/fintra && RAILS_ENV=production bundle exec rake scrape --silent'

I am using RVM by the way

khebbie
  • 2,490
  • 3
  • 31
  • 53

1 Answers1

7

OK I got it now. It turns out I am only running this site on my own computer and have no production environment and hence no production database...

The whenever configuration should be:

every 1.hours do
   rake "scrape", environment => "development"
end

I also had to run whenever with the environment:

whenever -w --set environment=development
khebbie
  • 2,490
  • 3
  • 31
  • 53