0

On a server I have a daemon and a Ruby application. We interact with the application through rake tasks, as it has no other interface.

What I'd like to do is have the daemon do its work and then call the application's rake task. So the daemon code would be:

DaemonKit::Cron.scheduler.every('1h') do
  ...
  #calling Daemon logic here
  ...

  `/bin/bash -l -c 'cd /path/to/application && RAILS_ENV=production bundle exec rake notify:daemon_finished'`
end

As far as I can tell, this should work. But I get an error from the application:

rake aborted!
cannot load such file -- active_record/railtie
/path/to/application/application.rb:7:in `require'
/path/to/application/config/application.rb:7:in `<top (required)>'
/path/to/application/Rakefile:5:in `require'
/path/to/application/Rakefile:5:in `<top (required)>'

Any ideas? Thanks.

Hopwise
  • 293
  • 2
  • 11
  • [This](http://stackoverflow.com/questions/16782198/cannot-load-railtie-after-upgrade-to-rails-4-per-ruby-railstutorial-org) should likely help you. – Aleksei Matiushkin Jan 28 '14 at 02:44
  • Sadly no. Not rails 4. If you could answer as an answer instead of a comment, that is best. – Hopwise Jan 28 '14 at 04:16

0 Answers0