I have some custom classes/modules defined under /app/lib
.
I have a Rake task, via whenever, that tries to load the environment then execute one of the class methods.
Here's an example of the rake task:
namespace :box do
task :fetch => :environment do
BoxInterface::Tasc::Fetcher.fetch
end
end
If I run BoxInterface::Tasc::Fetcher.fetch
from the Rails console, it works fine.
If I run bundle exec rake 'box:fetch'
I get this error:
uninitialized constant BoxInterface::Tasc
The file structure under lib is:
/app/lib/box_interface/tasc/fetcher.rb
The odd thing here is that we have a staging server that this code works fine under. Does this have something to do with the environment? I am unsure how to troubleshoot this.