u19964
u19964

Reputation: 3345

Resque cannot load module - no such file

I am doing resque in Rails. In the Rails project, I have a file name setup.rb and helper.rb in the same directory. In setup.rb I have

require './helper'

When I tried to run bundle exec rake resque:work QUEUE="*" or rake resque:work QUEUE="*" I got error. The error is:

No such file to load -- ./helper

When I tried to rails console, Dir.chdir to that directory and type in require './helper' it return true, which means it works fine. I cannot explain why the setup.rb cannot require './helper'.

Upvotes: 0

Views: 602

Answers (1)

arieljuod
arieljuod

Reputation: 15838

try using Rails.root for the file path and make it absolute instead of relative

Upvotes: 1

Related Questions