oh spree.
há algo errado com as instruções sql geradas nos arquivos de semente do país / estados.
aqui está o meu substituto, que é mais lento mas funciona
spree_core/db/default/spree/countries.rb
require 'carmen'
Carmen::Country.all.map do |country|
name = country.name
iso3 = country.alpha_3_code
iso = country.alpha_2_code
iso_name = country.name.upcase
numcode = country.numeric_code
states_required = country.subregions?
# country_inserts << [name, iso3, iso, iso_name, numcode, states_required].join(", ")
Spree::Country.new( :name => name,
:iso3 => iso3,
:iso => iso,
:iso_name => iso_name,
:numcode => numcode,
:states_required => states_required
).save!
end
canada = Spree::Country.find_by(iso: "CA")
Spree::Config[:default_country_id] = canada.id
e
spree_core/db/default/spree/states.rb
connection = ActiveRecord::Base.connection
state_inserts = []
Spree::Country.where(states_required: true).each do |country|
carmen_country = Carmen::Country.named(country.name)
carmen_country.subregions.each do |subregion|
name = connection.quote subregion.name
abbr = connection.quote subregion.code
country_id = connection.quote country.id
state_inserts << [name, abbr, country_id].join(", ")
Spree::State.new(:name => name, :abbr => abbr, :country_id => country_id).save!
end
end