2

When I upgraded from ruby 2.5.7 to ruby 2.6.5 with a rails 6.0.2 app, then all the rspec tests fail. An example error is

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.

Line 7 of application.rb is

Bundler.require(*Rails.groups)

I suspect I need to upgrade one or more of the gems. How do I fix this?

Obromios
  • 15,408
  • 15
  • 72
  • 127

1 Answers1

2

My guess is there's a call to Psych.safe_load somewhere. Its interface changed between 2.5.7 and 2.6.5. 2.5.7 takes whitelist_classes and whitelist_symbols as keyword arguments but 2.6.5 has changed them to permitted_classes and permitted_symbols breaking the interface.

It's possible you need to upgrade Bundler or another gem which uses Psych. You can try searching your gem sources for whitelist_classes. If you use RVM that will be $HOME/.rvm/gems/ruby-2.6.5/gems/.

Schwern
  • 153,029
  • 25
  • 195
  • 336