1

I'm using RoR on Windows, so first question will be: can I use whenever on Windows ?

At this moment it is not working at all. I tried this code:

   set :output, "#{path}/log/cron.log"
   set :environment, 'development'

  every 2.minutes do 
   command "rm '#{path}/log/text.txt'", environment => "development"
 end

Here is my console, when run whenever command:

 whenever
 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,5
 6,58 * * * * /bin/bash -l -c 'rm '\''E:/mus/RailsCasts PRO/164-cron-in-ruby-revi
 sed/164-cron-in-ruby-revised/schedules-after/log/text.txt'\'' >> E:/mus/RailsCas
 ts PRO/164-cron-in-ruby-revised/164-cron-in-ruby-revised/schedules-after/log/cro
  n.log 2>&1'

 ## [message] Above is your schedule file converted to cron syntax; your crontab
 file was not updated.
 ## [message] Run `whenever --help' for more options.

and whenever -i:

  whenever -i

 [fail] Couldn't write crontab; try running `whenever' with no options to ensure
 your schedule file is valid.

Second question: I need to create txt file or xls and add information into and after that - send it to PayPal(Mass Pay).

How I can create file using this gem ?

I have already managed to export data into xls format.

deny7ko
  • 2,315
  • 8
  • 37
  • 69
  • 3
    No you can't run it on Windows, because Windows doesn't have cron. – Mischa Aug 14 '12 at 13:17
  • This is a dup: http://stackoverflow.com/questions/6784149/how-to-make-whenever-gem-work-on-windows – deefour Aug 14 '12 at 13:20
  • If you want to schedule stuff on Windows you can use Windows Task Scheduler, but that most likely doesn't work with the cron notation that the whenever gem outputs. You could try to manually create scheduled tasks using Task Scheduler. Also see this question: http://stackoverflow.com/questions/132971/what-is-the-windows-version-of-cron – Mischa Aug 14 '12 at 13:24
  • Ok, thanks. But how can I use Ruby code in Task Shedule ? or I just choose .rb file as a programme ? – deny7ko Aug 14 '12 at 14:10

0 Answers0