最近更新了 ruby (2.5.3 到 2.7.1)和 Ruby on rails(5.2.2 到 6.1.1)版本。
之后当我运行 rspec ,我收到此错误:
Failure/Error: require File.expand_path("../../config/environment", __FILE__)
NoMethodError:
undefined method `new' for BigDecimal:Class
# ./config/application.rb:11:in `<top (required)>'
# ./config/environment.rb:2:in `<top (required)>'
spec_helper.rb 中发生错误如何调试 spec_helper 的代码,它是:
require File.expand_path("../../config/environment", __FILE__)
如何解决上述错误?我不确定哪个 gem/文件试图做
BigDecimal.new
最佳答案
正如@Tom Lord 在评论中建议将 shoulda matcher 更新为 3.1.3 对我有用
关于ruby-on-rails - 无方法错误 : undefined method `new' for BigDecimal:Class,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65778366/