rails 5 spree 3.2批量定价扩展

问题描述:

我试图安装批量定价扩展,它很痛苦。我没有发现这个错误很多,我不知道如何访问错误中的文件。任何帮助将非常感激。rails 5 spree 3.2批量定价扩展

轨产生spree_volume_pricing:安装

/Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/state_machines-0.4.0/lib/state_machines/assertions.rb:18:in `block in assert_valid_keys': Unknown key: :order. Valid keys are: :class_name, :anonymous_class, :foreign_key, :validate, :autosave, :table_name, :before_add, :after_add, :before_remove, :after_remove, :extend, :primary_key, :dependent, :as, :through, :source, :source_type, :inverse_of, :counter_cache, :join_table, :foreign_type, :index_errors (ArgumentError) 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/state_machines-0.4.0/lib/state_machines/assertions.rb:16:in `each_key' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/state_machines-0.4.0/lib/state_machines/assertions.rb:16:in `assert_valid_keys' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activerecord-5.0.3/lib/active_record/associations/builder/association.rb:78:in `validate_options' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activerecord-5.0.3/lib/active_record/associations/builder/association.rb:44:in `create_reflection' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activerecord-5.0.3/lib/active_record/associations/builder/association.rb:29:in `build' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activerecord-5.0.3/lib/active_record/associations.rb:1365:in `has_many' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/bundler/gems/spree_volume_pricing-e55ebaf35575/app/models/spree/variant_decorator.rb:2:in `block in <top (required)>' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/bundler/gems/spree_volume_pricing-e55ebaf35575/app/models/spree/variant_decorator.rb:1:in `class_eval' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/bundler/gems/spree_volume_pricing-e55ebaf35575/app/models/spree/variant_decorator.rb:1:in `<top (required)>' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:287:in `load' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:287:in `block in load' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:259:in `load_dependency' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:287:in `load' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/bundler/gems/spree_volume_pricing-e55ebaf35575/lib/spree_volume_pricing/engine.rb:5:in `block in activate' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/bundler/gems/spree_volume_pricing-e55ebaf35575/lib/spree_volume_pricing/engine.rb:4:in `glob' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/bundler/gems/spree_volume_pricing-e55ebaf35575/lib/spree_volume_pricing/engine.rb:4:in `activate' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:396:in `instance_exec' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:396:in `block in make_lambda' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:169:in `block (2 levels) in halting' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:547:in `block (2 levels) in default_terminator' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:546:in `catch' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:546:in `block in default_terminator' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:170:in `block in halting' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:454:in `block in call' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:454:in `each' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:454:in `call' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:101:in `__run_callbacks__' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:750:in `_run_prepare_callbacks' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/callbacks.rb:90:in `run_callbacks' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/reloader.rb:87:in `prepare!' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/railties-5.0.3/lib/rails/application/finisher.rb:53:in `block in <module:Finisher>' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/railties-5.0.3/lib/rails/initializable.rb:30:in `instance_exec' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/railties-5.0.3/lib/rails/initializable.rb:30:in `run' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/railties-5.0.3/lib/rails/initializable.rb:55:in `block in run_initializers' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:228:in `block in tsort_each' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:431:in `each_strongly_connected_component_from' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:349:in `block in each_strongly_connected_component' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `call' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:347:in `each_strongly_connected_component' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:226:in `tsort_each' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/2.4.0/tsort.rb:205:in `tsort_each' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/railties-5.0.3/lib/rails/initializable.rb:54:in `run_initializers' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/railties-5.0.3/lib/rails/application.rb:352:in `initialize!' 
    from /Users/danielhatcher/Desktop/rails/sticker_cove/config/environment.rb:5:in `<top (required)>' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:293:in `block in require' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:259:in `load_dependency' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.3/lib/active_support/dependencies.rb:293:in `require' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:102:in `preload' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run' 
    from /Users/danielhatcher/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' 
    from /Users/danielhatcher/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require' 

state-machines版本(0.4.0)是2 years old和你spree_volume_pricing提交(e55ebaf35575)是5 years old。有了这些条件,他们几乎不可能与rails版本5.0.3共同工作,该版本仅发布了16 days ago
从那个位置,我猜你的选择是:

  • 降级轨与那些宝石版本兼容的版本。

  • 使用主分支为你的宝石和手指交叉,这些版本至少与轨5.x的兼容(最后一次提交的spree_volume_pricing是2016年5月13日):

    gem 'state_machines', github: 'state-machines/state_machines', branch: :master 
    gem 'spree_volume_pricing', github: 'spree-contrib/spree_volume_pricing', branch: :master 
    
  • 更改为宝石,来自社区的更好支持。您可以使用aasm而不是state_machines。不知道替换spree_volume_pricing

  • 促进这些宝石的发展,使之与轨道5

祝你好运

兼容