Rails 7.1.1 - spawning error occurred - passenger - You have already activated stringio 3.0.0, but your Gemfile requires stringio 3.0.8
Asked Answered
D

2

6

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?
Decorator answered 19/10, 2023 at 9:16 Comment(5)
What version of Bundler do you use (bundler -v)? Did you try to update bundler (gem update bundler) as suggested in the error message?Mechellemechlin
Using the latest version already - v2.4.21Decorator
What command do you run? Do you run it with bundle exec like this bundle exec rails start?Mechellemechlin
Do you have psych set in your gemfile? If so, remove it and try to bundle installPerfusion
I'm encountering the same issue, in Rails 7.1 they added irb as dependency to railties in order to get "the latest version". This causes a cascade of dependencies to be required: rdoc, psych, stringio which in turn cause various installation issues (psych require libyaml, stringio conflicts with the default version)... I'm still fighting this but it's starting to get annoying.Selfconceit
S
6

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

Selfconceit answered 4/12, 2023 at 18:7 Comment(0)
A
0

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.

Ap answered 25/11, 2023 at 2:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.