Skip to content

Instantly share code, notes, and snippets.

@danman01
Last active August 29, 2015 13:56
Show Gist options
  • Save danman01/8806315 to your computer and use it in GitHub Desktop.
Save danman01/8806315 to your computer and use it in GitHub Desktop.
spree_heroku_errors.md

Here's some errors I ran into:

I am getting nil country.states error when at checkout/address. I tried to dig around in the code, but haven't gotten too far. I do have a default country ID set, so maybe my default @order.address is nil...I will need to debug further. Again, this is with a fresh postgresql database.

(Also, where is checkout#edit action? There's a lot of modules to dig into and I haven't been able to find it. If I find the edit action, I would throw a debugger in there to see what my @order has)

So that was all on heroku (https://partsomobile.herokuapp.com/).

I felt I should have been testing locally first, so I started my server and I added a product called mug, but do not see where I specify quantity available.

notes: I ran rake db:seed for mysql, but then switched databases to postgresql, so I do not have seed values - is there a way to setup Spree with postgresql as the default, or should we re run the rake db:seed command after switching databases?)

When I go to the root url and select my new product, and click 'add to cart', I get returned to the current page with a flash message set, "Selected quantity of 'Mug' is not available."

Looking at the post to populate Spree::OrdersController.populate, I don't see any quantity variable being passed, but do see these parameters being passed:

"variants"=>{"1"=>"3"}

here's the heroku error I am getting relating to nil object.states:

ActionView::Template::Error (undefined method `states' for nil:NilClass):

2014-02-04T15:51:50.002300+00:00 app[web.1]:     35: 

2014-02-04T15:51:50.002300+00:00 app[web.1]:     36:   <% if Spree::Config[:address_requires_state] %>

2014-02-04T15:51:50.002300+00:00 app[web.1]:     37:     <p class="field" id=<%="#{address_id}state" %>>

2014-02-04T15:51:50.002300+00:00 app[web.1]:     38:       <% have_states = !address.country.states.empty? %>

2014-02-04T15:51:50.002658+00:00 app[web.1]:     39:       <%= form.label :state, Spree.t(:state) %><span class='required' id=<%="#{address_id}state-required"%>>*</span><br/>

2014-02-04T15:51:50.002658+00:00 app[web.1]:     40: 

2014-02-04T15:51:50.002658+00:00 app[web.1]:     41:       <% state_elements = [

2014-02-04T15:51:50.002658+00:00 app[web.1]:   vendor/bundle/ruby/2.0.0/gems/spree_frontend-2.1.3/app/views/spree/address/_form.html.erb:38:in `_47b6777a26e35326f9341efae8cc4340'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment