Search code examples
ruby-on-railsrakecapistranospreerails-i18n

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


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.


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")