taskrabbit / resque-bus

Use resque as a message bus!
http://tech.taskrabbit.com/blog/2013/09/28/resque-bus/
127 stars 6 forks source link

"LoadError: No such file to load -- application_controller" from Engine. #9

Closed ionmx closed 10 years ago

ionmx commented 10 years ago

I'm trying to use resque-bus in an engine, but got "LoadError: No such file to load -- application_controller" when I try to run:

my_app/engines/my_engine/rake resquebus:setup resque:work

My task is located at my_app/engines/my_engine/lib/tasks/appB_subscriptions.rake

Which is the best way to achieve that?

ps. I've tried to fix it modifying resque: https://github.com/resque/resque/blob/master/lib/resque/tasks.rb#L38 but I guess you have a better way to do this.

bleonard commented 10 years ago

Have a stack?

bleonard commented 10 years ago

here's our resque.rake file in /lib/tasks/ if it helps (we use engines too but this is in the main one)

require 'resque/tasks'
require 'resque_scheduler/tasks'
require "resque_bus/tasks"

namespace :resque do
  task :setup => [:environment] do
    require 'resque_scheduler'
    require 'resque/scheduler'
  end

end
bleonard commented 10 years ago

It's also possible you're doing this in development and this is the first time you've fully done an eager load, which preloads everything. That is to say, if your file names and paths a bit off, things might blow up.

Put another way, eager_load! might blow up in the console too.

ionmx commented 10 years ago

resque.rake fixes the problem, thanks!