【问题标题】:rails 5 spree 3.2 volume pricing extensionrails 5 spree 3.2 批量定价扩展
【发布时间】:2017-05-28 04:56:28
【问题描述】:

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

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'

【问题讨论】:

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


    【解决方案1】:

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

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

    • 为您的 gem 使用 master 分支并祈祷这些版本至少与 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
      
    • 在社区提供更好的支持下更改为 gem。您可以使用aasm 而不是state_machines。不知道替换 spree_volume_pricing

    • 为这些 gem 的开发做出贡献,并使它们与 rails 5 兼容。

    祝你好运

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-04-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多