Rykian / clockwork

A scheduler process to replace cron.
MIT License
544 stars 66 forks source link

cannot load such file -- ./clock.rb (LoadError) #38

Closed dsdavis4 closed 6 years ago

dsdavis4 commented 6 years ago

I am following the quick start guide with a fresh install of clockwork. I have added the following clock.rb to my lib folder.

require 'clockwork'
require './config/boot'
require './config/environment'

module Clockwork

  handler do |job|
    puts "Running #{job}"
  end

  every(10.seconds, 'expire_ads.job') { puts "hi" }
end

However running 'clockwork clock.rb' gives me the following error

/Users/drewdavis/.rbenv/versions/2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in `require': cannot load such file -- ./clock.rb (LoadError)
        from /Users/drewdavis/.rbenv/versions/2.4.2/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:120:in `require'
        from /Users/drewdavis/.rbenv/versions/2.4.2/lib/ruby/gems/2.4.0/gems/clockwork-2.0.2/bin/clockwork:12:in `<top (required)>'
        from /Users/drewdavis/.rbenv/versions/2.4.2/bin/clockwork:23:in `load'
        from /Users/drewdavis/.rbenv/versions/2.4.2/bin/clockwork:23:in `<main>'

I get the same error even with the entire file commented out. I haven't found a solution in the issues or with google search and am a bit lost on where the issue is coming from. Any help would be much appreciated.

jurgenwerk commented 6 years ago

hey @dsdavis4, can you share the solution? I have the same problem running the daemon.