After installing I18n in Rails Spree application rake db:migrate does not work and methods and pages cannot be found

StackOverflow https://stackoverflow.com/questions/21222071

Question

In my Ruby on Rails Spree Commerce app I try to run

bundle exec rake railties:install:migrations 
bundle exec rake db:migrate

via ssh on the server since I think that will solve some issues I am having with methods that cannot be found (e.g., NoMethodError in Spree::OrdersController#populate undefined methodtax_total='` and even products that cannot be displayed after I added localization with I18n.

It aborts and says:

rake aborted!
An error has occurred, this and all later migrations canceled:

Index name 'index_spree_adjustments_on_source_type_and_source_id' on table 
'spree_adjustments' already exists

See full gist. I am not even sure if I need to run these two commands on the server. I did do it locally first too and then deployed with Capistrano.

Well I hope someone can explain a bit more about this and provide some insights.

Was it helpful?

Solution

Somewhere, the method .tax_total= is being called on a Spree::Order that does not have that method defined.

Perhaps you are missing an attribute declaration?

EDIT

In your migration file, comment the line that say

add_index("problematic index")

OTHER TIPS

Problem turned out that I installed Bootstrap 2 which is used in Spree Stable-2-0. When I changed to Bootstrap 3 (called Spree_Bootstrap_Frontend) here all methods worked again!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top