-
Notifications
You must be signed in to change notification settings - Fork 549
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bundler seems to be invoked too late to get the correct versions of some built-in gems #2409
Comments
One more workaround I found: include the following in the nginx config:
|
I'm working on an option to require bundler when ruby starts up, which should help in these cases. It won't be on by default because it can ironically cause a conflict with two bundlers being loaded (an old one and a new one, in that order, doesn't work well). |
6.0.13 is released with the new option. |
The latest passenger include a new option to load ruby bundles earlier, working around deployment issues. See: * phusion/passenger#2410 * phusion/passenger#2409
The latest passenger include a new option to load ruby bundles earlier, working around deployment issues. See: * phusion/passenger#2410 * phusion/passenger#2409
The latest passenger include a new option to load ruby bundles earlier, working around deployment issues. See: * phusion/passenger#2410 * phusion/passenger#2409
The latest passenger include a new option to load ruby bundles earlier, working around deployment issues. See: * phusion/passenger#2410 * phusion/passenger#2409
The latest passenger include a new option to load ruby bundles earlier, working around deployment issues. See: * phusion/passenger#2410 * phusion/passenger#2409
The commit 229ddea introduces a bug on Passenger: ``` App 2590953 output: Error: The application encountered 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)() ``` A (temporary) workaround is to fix strscan to 3.0.1. The issue seems to be this one: phusion/passenger#2409 According to these issues, the best workaround is to use `PassengerPreloadBundler` in order to load right versions of gems. Ref phusion/passenger#2410 (comment)
The latest passenger include a new option to load ruby bundles earlier, working around deployment issues. See: * phusion/passenger#2410 * phusion/passenger#2409
FYI, we were receiving the following error:
What worked was manually install sudo gem install strscan:3.1.0 This ensures that one is used instead of the default 3.0.7: gem list strscan
*** LOCAL GEMS ***
strscan (3.1.0, default: 3.0.7) I tried other methods before doing this that I saw elsewhere, including:
Neither worked. I did get it working by pinning my version of Hope that helps others. |
@joshuapinter (and anyone else affected by this issue), we just encountered the same issue after upgrading Ruby, and fixed the issue by using the passenger_preload_bundler nginx option. passenger_preload_bundler on; This forces passenger to load bundler as soon as possible, which then prevents system default gems from being loaded but uses the Gemfile defined versions instead. |
@KieranP We just tested this in our Staging environment and everything appears to be working perfectly. Thanks! To be clear, we removed the |
1) What is the problem?
Steps to Reproduce
io-wait
included in itsGemfile.lock
at a different version than the one built into rubyio-wait 0.2.1
onruby 3.0.2
(the included version is0.1.0
)deployment
flag so that it installs gems to your app'svendor/bundle
bundle exec
Observed behavior
The app fails to start:
Expected behavior
Passenger loads bundler before
io-wait
gets required so that the correct version is loadedWorkaround for now
Invoke nginx with
bundle exec
, this ensures that the correct versions of the gems are loaded when passenger starts executing ruby code2) Passenger version and integration mode
Originally passenger 6.0.11/nginx, reproduced on passenger 6.0.12/standalone
3) OS or Linux distro
Originally RockyLinux 8.4 x86_64, reproduced on Debian 11.1 x86_64
4) Passenger installation method:
Originally source tarball, reproduced with just passenger gem
5) Your app's programming language (including any version managers) and framework (including versions)
Ruby 3.0.2 RVM, originally Rails 6.1.4.4, reproduced with no rails (pure rack 2.2.3)
6) Are you using a PaaS and/or containerization? If so which one?
We are using Docker (local version 20.10.11, this also happened in CircleCI's docker environment whose version I don't know)
7) Anything else about your setup that we should know?
Here's the minimal Gemfile and config.ru I used to reproduce, this was done in the official ruby 3.0.2 docker image:
Gemfile:
(again be sure to run
bundle install
with thedeployment
option)config.ru:
I ran
gem install passenger
to get passenger standalone installedOne other thing to note,
io-wait
ended up getting managed by bundler because ruby 3.1.0+ no longer bundles thenet-smtp
gem, so that has to be included in the Gemfile (net-smtp
depends onnet-protocol
which depends onio-wait
). Everything works at present on ruby 3.1.0 as the latest version ofio-wait
is bundled with ruby 3.1.0, however once that gem updates the versions will be mismatched again and things will break.Additionally, here's the full error including the stack trace:
The text was updated successfully, but these errors were encountered: