rails 5 spree 3.2批量定价扩展

时间:2017-05-28 04:56:28

标签: ruby-on-rails ruby-on-rails-5 spree

我正在尝试安装批量定价扩展程序,这很痛苦。我没有发现这个错误很多,我不知道如何在错误中访问该文件。任何帮助都会非常感激。

  

rails生成spree_volume_pricing:install

/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'

1 个答案:

答案 0 :(得分:0)

您的state-machines版本(0.4.0)为2 years old,而您的spree_volume_pricing提交(e55ebaf35575)为5 years old。由于这些条件几乎不可能,因此他们使用rails版本5.0.3,该版本仅发布16 days ago 从那个位置,我想你的选择是:

  • 将rails降级为与这些gem版本兼容的版本。

  • 为您的宝石使用主分支,并指出这些版本至少与rails 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

  • 有助于开发这些宝石并使它们与rails 5兼容。

祝你好运