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

て烟熏妆下的殇ゞ 提交于 2019-12-08 00:46:38

问题


I had this issue a couple of months ago, posted it on Spree's GitHub page, then figured out the solution myself and posted it on that same issue. Two months later, I'm still getting comments on that same issue from Googlers who had the same error message, so I figure it's worth posting my solution on this website as well just in case anyone is having the same problem but isn't looking on GitHub.

The issue: trying to create a brand new Spree app, following the exact instructions in Spree's documentation, gives the following error when you try to run spree install --auto-accept or rails g spree:install:

undefined method `raise_in_transactional_callbacks=' for ActiveRecord::Base:Class (NoMethodError)

Solution below...


回答1:


The problem: I'd created a new rails app with rails new, which had automatically created an app using rails 4.2.0beta. Then I had issues with gem incompatibilities, so I'd changed the version number of a few gems, including downgrading Rails back to 4.1.8.

BUT the config setting raise_in_transactional_callbacks is new in Rails 4.2.0, so in earlier versions of Rails it will raise an error. If you're getting this error message you need to remove the line config.active_record.raise_in_transactional_callbacks = true from config/application.rb.



来源:https://stackoverflow.com/questions/27526332/cant-create-a-new-spree-app-undefined-method-raise-in-transactional-callback

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!