synchronysing dependencies between system and application

Viewed 881

The following error

You have already activated strscan 3.0.1, but your Gemfile requires strscan 3.0.3.  
Since strscan is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports strscan as a default gem. (Gem::LoadError)

where bundle -v Bundler version 2.3.13

regards a dependency which is not directly invoked in the Gemfile. The Gemfile.lock does state strscan (3.0.3) strscan is invoked by net-imap (0.2.3)

gem update --system
gem update bundler
touch tmp/restart.txt

does not solve the issue.

How can this versioning matter be ironed out? Be it via explicit verisoning or removal of dependency

3 Answers

Just use this command on your SSH server

gem update strscan

to check current strscan version use

gem list | grep strscan

Pin strscan gem version to 3.0.1.

In your Gemfile:

gem "strscan", "3.0.1"

Then bundle update to update your Gemfile.lock.

That should fix the issue.

Based on this, I believe this will be fixed in Ruby 3.1.3+ and you should be able to remove this line from your Gemfile but I'm not sure.

What's tricky about this is we only ran into the issue in Production and Staging environments, not Development or Test environments.

Another good reason to deploy everything to Staging first, test and then deploy to Production.

Related