Re: [Rails-core] Rails production load order giving uninitialized constant (NameError)

112 views
Skip to first unread message

Carlos Antonio da Silva

unread,
Jun 21, 2012, 6:59:00 PM6/21/12
to rubyonra...@googlegroups.com
Perhaps you'd like to try the Ruby on Rails: Talk mailing list instead, for general questions and help. The Core list is meant to discuss new features and changes in Rails. Thanks.

-- 
At.
Carlos Antonio

On Thursday, June 21, 2012 at 5:16 PM, A L wrote:

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: https://gist.github.com/2965034

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!

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Core" group.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-core/-/lXyOOJWdcvAJ.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-co...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-core?hl=en.

A L

unread,
Jun 22, 2012, 4:59:10 PM6/22/12
to rubyonra...@googlegroups.com
Ruby on Rails Talk sounds like it.  Thanks for the heads up!
Reply all
Reply to author
Forward
0 new messages