When upgrading to the latest version of rails, I'm experiencing the following error with passenger refusing to start.

The application encountered the following error: You have already activated stringio 3.0.0, but your Gemfile requires stringio 3.0.8. Since stringio is a default gem, you can either remove your dependency on it or try updating to a newer version of bundler that supports stringio as a default gem. (Gem::LoadError)

Looking up the version of gems installed, only stringio (default: 3.0.0) is defined.

and in my gemlock file we now have

psych (5.1.1.1) stringio and

stringio (3.0.8)

One suggestion to this problem that my stack support team have suggested is to place gem 'stringio', '3.0.0' in the gemfile and force it to use this version.

This doesn't feel right to me and is somthing that I've never had to do before

Questions:

  • Can anyone provide advice on if the above solution is the correct thing to do?
  • Can anyone help point me in the right direction as to another fix to solve this issue and where I should be looking?
2

There are 2 answers

0
erwin On

I ran into the same issue and tried everything I could think of... Rebuilding Passenger Docker, updating bundler, manually removing the stringio gem (which isn't permitted because it's a default gem).

The only solution that I came up with that actually worked is updating my project's Gemfile to explicitly require the version of stringio that Passenger Docker is using by default.

For me, that meant editing ./Gemfile to add:

gem "stringio", "3.0.1"

I agree with you that it feels like a very low quality workaround that will likely create more maintenance overhead in the future.

0
Adrien Rey-Jarthon On

The proper solution is to add passenger_preload_bundler on; to your NGINX config. Then you don't have to use outdated gems.

https://www.phusionpassenger.com/docs/references/config_reference/nginx/#passenger_preload_bundler

Source from reddit