Obromios
Obromios

Reputation: 16383

Rails 5 DEPRECATION WARNING: to_prepare is deprecated

When running rspec tests, I am getting the following deprecation warning

DEPRECATION WARNING: to_prepare is deprecated and will be removed from Rails 5.1 (use ActiveSupport::Reloader.to_prepare instead) (called from <top (required)> at /Users/Chris/Sites/golf_mentor/config/environment.rb:5)

Line 5 of my environment.rb is just

Rails.application.initialize!

How do I fix the code so this deprecation warning does not occur?

Upvotes: 1

Views: 1255

Answers (1)

Alter Lagos
Alter Lagos

Reputation: 12550

That message for sure is generated because a gem is using that deprecated method. Maybe with rspec -b you could have more insight about what gem is and update that gem (in the best case that the warning was already solved). If that doesn't work, another option could be to update your gems until find which one is causing the warning. The last option is just ignore the warning because is not going to cause you problems until you update your app to rails 5.1 and when that time comes you will know which gem is because it will throw an exception.

Upvotes: 1

Related Questions