Rails production load order giving uninitialized constant (NameError)

Hi,

I have a related but separate question. Again, please redirect me if
I’m
in the wrong place.

I’ve been getting this error in production (on Heroku) only (it happens
when the application is loading):

2012-06-21T09:30:19+00:00 app[web.1]: /app/app/controllers/spree/
checkout_controller_decorator.rb:3:in `block in ': uninitialized
constant
Spree::Calculator::CouldNotCalculateShipping (NameError)

Here’s the gist of my decorator files: uninitialized constant Spree::Calculator::CouldNotCalculateShipping (NameError) · GitHub

I’m trying to rescue errors from my Spree calculators. I’m thinking it’s
an
issue with the load order, but am not familiar enough to know where to
tweak things.

I’ve tried:

require ‘spree/calculator_decorator’

in the checkout_controller_decorator.rb.

and adding:

Dir.glob(File.join(File.dirname(FILE), “…/app/**/_decorator.rb”))
do
|c|
Rails.configuration.cache_classes ? require(c) : load(c)
end

per http://guides.spreecommerce.com/logic_customization.html

I’m thinking this isn’t a Spree issue, but an engines issue that I’m
getting stuck on. It’s probably not even an issue, but just me not
knowing
how everything is tied together in Rails and engines.

Any help will be greatly appreciated. Even just to give me something
else
to try or look.

Thanks for reading!