-
Notifications
You must be signed in to change notification settings - Fork 208
Fix gem path resolution for JRuby 9.4+
and Rails 7+
#572
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
base: master
Are you sure you want to change the base?
Conversation
qisantanu
commented
Sep 18, 2025
- Consistency with war.erb template behavior
- Isolation - only uses gems packaged in the WAR
- No system gem conflicts - prevents loading host system gems
- Self-contained deployment - WAR file is completely portable
- Add Gem.paths configuration in bundler.erb template - Resolves 'bundle install' errors when running WAR files - Ensures RubyGems finds bundled gems correctly in servlet containers
@kares , can you please review and merge this PR? It will be helpful for our further development. We are in a transition period to update our app. |
While I'm not a warbler expert and dont have maintainer permissions on this project, I'm also keen to help here if I can since there are similar challenges to jruby-rack with build infra, versions, bundler modernisation etc. @qisantanu Could you perhaps summarise the spefic issue you're trying to resolve for the non-expert (the root cause seems to not be well understood) especially how it relates to #564? Seems this is basically an attempt to fix #539 however you appear to have considered some other aspects. Especially as there is an existing comment at https://github.com/jruby/warbler/pull/564/files#r2212851704 indicating this might not be the right place to address the issue, we should try and resolve these. |
Hi @chadlwilson , I am also not an expert in the warble gem. but we are using it for our enterprised app to deploy under weblogic for a long time.
This results in an HTTP 500 error during execution. Root Cause (Suspected)The Similarly, We tried this version of warbler in our Rails7 app's Gemfile. And now we can run the generated war file under the weblogic without the error. |
Which JRuby and jruby-rack versions are you using? And which change/upgrade triggered the problem starting for you? The challenge seems to be that no-one in #539 other than OP (which is now outdated) seems to have reported with fuller environment context, meaning any hasty fix risks breaking things for other people's environments. I don't imagine anyone is likely to feel comfortable merging without understanding the root cause (and what changed upstream to create the issue) more clearly. |
It’s a mildly separate issue, but you should really be using the latest ruby 9.4 patch version - that one is very old, and thus unsupported. side-question - why do you include screenshots from text and cut off the error traces rather than including all config? To replicate your issue/env you would like people to type out your gemfiles by hand? |
I'm back and looking this over. Thanks for the patch @qisantanu! |
@qisantanu Could you provide a simple way to reproduce the issue you're seeing, like a small repository that fails the same way? I'm also having trouble understanding if this is the right way or the right place to fix this issue. |
Hi @headius, Thanks for looking into this! I’ve pushed a minimal JRuby Rails 7.1 app that reproduces the issue to a public repository: https://github.com/qisantanu/myapp_for_weblogic The repo includes: Rails 7.1, JRuby 9.4.5.0 No database (simplified for reproduction) Added a README as well. The error I am getting after installing the war file in weblogic:
|
FYI - we are also seeing this issue after upgrading our app to Rails 7 on jruby 9.4.14.0 |
Unfortunately this approach does not seem a good idea to me, as it ignores existing config values that interact with these same values, and seems to fail to get at the root cause? It seems there is a lot of historical mess here to unpack , as noted in #564 along with a number of other bundler quirks in issues over time :( |
@qisantanu I'm trying to get your example app deployed today. WebLogic is complicated to get and install these days! I tried deploying on Tomcat but got an error at app deploy that seems to prevent me going further:
@mbiang Thank you for jumping in... clearly this is a problem we need to fix and get released. |
I spent some time trying to figure things out across jruby-rack, warbler etc and got lost in all of the various hacks/config options and the fact that there is an open PR for Bundler 2 support, yet everyone is obviously using Bundler 2 already. Probably a bit beyond me right now, sadly. |
Hi @headius , I make some commits to fix the issue. You need to run
And then I tried with the fixes from my warbler branch. And I can render the homepage. |
Yes, it’s the same error. It’s not specific to WebLogic, but does manifest specifically when sourcing warbler from git rather than a published gem. I think the reason we see a lot of reports is that there hasn’t been a published warbler for some time so lots of people are trying to install off master (to use unpublished fixes there) and thus hitting this additional issue on top of the one they were trying to use master to fix :) This patch is based on #539 (comment) which guesses it being related to a much earlier issue at #430 |