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?
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 takeswhitelist_classes
andwhitelist_symbols
as keyword arguments but 2.6.5 has changed them topermitted_classes
andpermitted_symbols
breaking the interface.It's possible you need to upgrade
Bundler
or another gem which usesPsych
. You can try searching your gem sources forwhitelist_classes
. If you use RVM that will be$HOME/.rvm/gems/ruby-2.6.5/gems/
.