Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ruby-on-rails/64.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 在cron can';找不到数据库表_Ruby On Rails_Rake_Whenever - Fatal编程技术网

Ruby on rails 在cron can';找不到数据库表

Ruby on rails 在cron can';找不到数据库表,ruby-on-rails,rake,whenever,Ruby On Rails,Rake,Whenever,我已经用where创建了cron作业(https://github.com/javan/whenever): 当我手动运行rake scrape任务时,它运行良好,但当cron运行时,我得到: rake aborted! Could not find table 'beskeds' 运行的命令是: /bin/bash -l -c 'cd /Users/klaus/Documents/src/Ruby/rails/fintra && RAILS_ENV=production bu

我已经用where创建了cron作业(https://github.com/javan/whenever):

当我手动运行rake scrape任务时,它运行良好,但当cron运行时,我得到:

rake aborted!
Could not find table 'beskeds'
运行的命令是:

/bin/bash -l -c 'cd /Users/klaus/Documents/src/Ruby/rails/fintra && RAILS_ENV=production bundle exec rake scrape --silent'
顺便说一下,我正在使用RVM

好的,我现在就知道了。 事实证明,我只是在自己的计算机上运行此网站,没有生产环境,因此没有生产数据库

配置应为:

every 1.hours do
   rake "scrape", environment => "development"
end
我还必须在任何环境下运行:

whenever -w --set environment=development

另外一个用于回答自己的问题并为他人发帖
whenever -w --set environment=development