whitelist_classes 运行 rspec 与 ruby 2.6.5 时出错
whitelist_classes error when running rspec with ruby 2.6.5
当我使用 rails 6.0.2
应用程序从 ruby 2.5.7
升级到 ruby 2.6.5
时,所有 rspec 测试都失败了。一个示例错误是
An error occurred while loading ./spec/models/account_spec.rb.
Failure/Error: require File.expand_path('../../config/environment', __FILE__)
ArgumentError:
unknown keywords: whitelist_classes, whitelist_symbols
# ./config/application.rb:7:in `<top (required)>'
# ./config/environment.rb:2:in `require_relative'
# ./config/environment.rb:2:in `<top (required)>'
# ./spec/rails_helper.rb:2:in `<top (required)>'
# ./spec/models/account_spec.rb:1:in `<top (required)>'
No examples found.
application.rb
的第 7 行是
Bundler.require(*Rails.groups)
我怀疑我需要升级一个或多个 gem。我该如何解决这个问题?
当我使用 rails 6.0.2
应用程序从 ruby 2.5.7
升级到 ruby 2.6.5
时,所有 rspec 测试都失败了。一个示例错误是
An error occurred while loading ./spec/models/account_spec.rb.
Failure/Error: require File.expand_path('../../config/environment', __FILE__)
ArgumentError:
unknown keywords: whitelist_classes, whitelist_symbols
# ./config/application.rb:7:in `<top (required)>'
# ./config/environment.rb:2:in `require_relative'
# ./config/environment.rb:2:in `<top (required)>'
# ./spec/rails_helper.rb:2:in `<top (required)>'
# ./spec/models/account_spec.rb:1:in `<top (required)>'
No examples found.
application.rb
的第 7 行是
Bundler.require(*Rails.groups)
我怀疑我需要升级一个或多个 gem。我该如何解决这个问题?