疯狂上班时的错误?

时间:2017-12-05 02:32:16

标签: ruby-on-rails ruby spree

首先,我要遵循官方文档中的步骤

https://github.com/spree/spree

我安装了Rails 5.1,所以我复制了以下gems并运行了bundle install

gem 'spree', '~> 3.4.0'
gem 'spree_auth_devise', '~> 3.3'
gem 'spree_gateway', '~> 3.3'

我也跑了

bundle update i18n

当我运行第一台发电机时

rails g spree:install --user_class=Spree::User

我收到以下错误

rails g spree:install --user_class=Spree::User
/usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-5.1.4/lib/active_record/dynamic_matchers.rb:22:in `method_missing': undefined method `raise_in_transactional_callbacks=' for ActiveRecord::Base:Class (NoMethodError)
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-5.1.4/lib/active_record/railtie.rb:112:in `block (3 levels) in <class:Railtie>'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-5.1.4/lib/active_record/railtie.rb:111:in `each'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-5.1.4/lib/active_record/railtie.rb:111:in `block (2 levels) in <class:Railtie>'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `instance_eval'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:69:in `block in execute_hook'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:60:in `with_execution_control'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:65:in `execute_hook'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:41:in `block in on_load'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:40:in `each'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/lazy_load_hooks.rb:40:in `on_load'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activerecord-5.1.4/lib/active_record/railtie.rb:110:in `block in <class:Railtie>'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `instance_exec'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/initializable.rb:30:in `run'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/initializable.rb:59:in `block in run_initializers'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:228:in `block in tsort_each'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:431:in `each_strongly_connected_component_from'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:349:in `block in each_strongly_connected_component'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `call'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:347:in `each_strongly_connected_component'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:226:in `tsort_each'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/2.3.0/tsort.rb:205:in `tsort_each'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/initializable.rb:58:in `run_initializers'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/railties-5.1.4/lib/rails/application.rb:353:in `initialize!'
        from /home/ubuntu/workspace/config/environment.rb:5:in `<top (required)>'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/polyglot-0.3.5/lib/polyglot.rb:65:in `require'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:258:in `load_dependency'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/application.rb:102:in `preload'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
        from /usr/local/rvm/gems/ruby-2.3.4/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from /usr/local/rvm/rubies/ruby-2.3.4/lib/ruby/site_ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from -e:1:in `<main>'

1 个答案:

答案 0 :(得分:1)

鉴于此post,我会尝试bundle update或按照该帖子中的说明进行操作

Can't create a new Spree app: "undefined method `raise_in_transactional_callbacks='"