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.