Cannot run program crontab on windows

117 views
Skip to first unread message

sri....@in4systems.com

unread,
Aug 19, 2015, 7:04:41 AM8/19/15
to Whenever Gem
Hi, I installed the whenever gem to my jruby rails application,

Gemfile:

gem 'whenever', require: false

Schedule.rb

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

every 1.minute do
  command "echo 'you can use raw cron syntax too'", environment => "development"
end

on the gitbash terminal(windows)

I tried, 

jruby -S whenever

* * * * * /bin/bash -l -c 'echo '\''you can use raw cron syntax too'\'' >> C:/Users/Sriganeshk/Documents/Promaster4Rails/log/cron.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.


whenever --update-crontab or whenever -i

IOError: Cannot run program "crontab" (in directory "C:\Users\Sriganeshk\Documents\Promaster4Rails"): CreateProcess error=2, The system cannot find the file specified
          popen at org/jruby/RubyIO.java:4344
  write_crontab at C:/jruby-1.7.15/lib/ruby/gems/shared/gems/whenever-0.9.4/lib/whenever/command_line.rb:72
            run at C:/jruby-1.7.15/lib/ruby/gems/shared/gems/whenever-0.9.4/lib/whenever/command_line.rb:35
        execute at C:/jruby-1.7.15/lib/ruby/gems/shared/gems/whenever-0.9.4/lib/whenever/command_line.rb:6
         (root) at C:/jruby-1.7.15/lib/ruby/gems/shared/gems/whenever-0.9.4/bin/whenever:41
           load at org/jruby/RubyKernel.java:1081
         (root) at C:/jruby-1.7.15/bin/whenever:23

I dont know where I did wrong. Thanks for looking into this issue and some suggestions please.






aaron.k...@gmail.com

unread,
Nov 20, 2018, 2:43:38 PM11/20/18
to Whenever Gem
Sorry to see no activity on this question. Did you ever find an answer? I am having a similar error with JRuby.
Reply all
Reply to author
Forward
0 new messages