Skip to content
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::GemNotFound: Could not find ... in locally installed gems #539

Open
dinosaurjunior opened this issue Apr 2, 2023 · 4 comments
Open

Comments

@dinosaurjunior
Copy link

Hello,

I am using Warbler 2.0.5 with JRuby 9.4.2.0. When I generate a WAR, it will work fine on the system I generated it.

If I use that war on a different system, I will get an error that my gems are missing however they seem to be there in the WAR archive.

02-Apr-2023 11:21:13.585 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: contextInitialized()
02-Apr-2023 11:21:13.585 INFO [main] org.apache.catalina.core.ApplicationContext.log SessionListener: contextInitialized()
02-Apr-2023 11:21:13.585 INFO [main] org.apache.catalina.core.ApplicationContext.log ContextListener: attributeAdded('StockTicker', 'async.Stockticker@186f8716')
02-Apr-2023 11:29:28.491 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log INFO: jruby 9.4.2.0 (3.1.0) 2023-03-08 90d2913fda Java HotSpot(TM) 64-Bit Server VM 25.361-b09 on 1.8.0_361-b09 +jit [x86_64-mswin32]
02-Apr-2023 11:29:28.493 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log INFO: using a shared (threadsafe!) runtime
02-Apr-2023 11:29:37.165 INFO [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log An exception happened during JRuby-Rack startup
Could not find rack-2.2.6.4, sinatra-3.0.5, mustermann-3.0.0, rack-protection-3.0.5, tilt-2.0.11 in locally installed gems
--- System
jruby 9.4.2.0 (3.1.0) 2023-03-08 90d2913fda Java HotSpot(TM) 64-Bit Server VM 25.361-b09 on 1.8.0_361-b09 +jit [x86_64-mswin32]
Time: 2023-04-02 11:29:37 -0700
Server: Apache Tomcat/9.0.73
jruby.home: uri:classloader://META-INF/jruby.home

--- Context Init Parameters:
public.root = /
rack.env = production

--- Backtrace
Bundler::GemNotFound: Could not find rack-2.2.6.4, sinatra-3.0.5, mustermann-3.0.0, rack-protection-3.0.5, tilt-2.0.11 in locally installed gems
materialize at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:507
specs at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:187
specs_for at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:244
setup at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/runtime.rb:18
setup at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler.rb:161
require at uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler.rb:186

at C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\config.ru:2
instance_eval at org/jruby/RubyBasicObject.java:2506
instance_eval at org/jruby/RubyBasicObject.java:2534
initialize at uri:classloader:/vendor/rack-1.6.13/rack/builder.rb:55
new at org/jruby/RubyClass.java:931
at C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\config.ru:1

--- RubyGems
Gem.dir: uri:classloader:/META-INF/jruby.home/lib/ruby/gems/shared
Gem.path:
C:\Windows\ServiceProfiles\LocalService/.local/share/gem/jruby/3.1.0
uri:classloader:/META-INF/jruby.home/lib/ruby/gems/shared
Activated gems:
jar-dependencies-0.4.1
did_you_mean-1.6.1
stringio-3.0.5-java
bundler-2.3.25
fileutils-1.6.0
time-0.1.0
uri-0.11.0

--- Bundler
Bundler.bundle_path: uri:classloader:/META-INF/jruby.home/lib/ruby/gems/shared
Bundler.root: C:/Program Files/Apache Software Foundation/Tomcat 9.0/webapps/stock-service/WEB-INF
Gemfile: C:/Program Files/Apache Software Foundation/Tomcat 9.0/webapps/stock-service/WEB-INF/Gemfile
Settings:
gemfile = C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\Gemfile
without = [:development, :test, :assets]

--- JRuby-Rack Config
compat_version =
default_logger = org.jruby.rack.logging.StandardOutLogger@5704ad4a
equals = <error: >
err = org.apache.tomcat.util.log.SystemLogHandler@261ee264
filter_adds_html = true
filter_verifies_resource = false
ignore_environment = false
initial_memory_buffer_size =
initial_runtimes =
jms_connection_factory =
jms_jndi_properties =
logger = org.jruby.rack.logging.ServletContextLogger@30c84ac4
logger_class_name = servlet_context
logger_name = jruby.rack
maximum_memory_buffer_size =
maximum_runtimes =
num_initializer_threads =
out = org.apache.tomcat.util.log.SystemLogHandler@a36f801
rackup =
rackup_path =
rewindable = true
runtime_arguments =
runtime_environment =
runtime_timeout_seconds =
serial_initialization = false
servlet_context = org.apache.catalina.core.ApplicationContextFacade@592043c7
throw_init_exception = false

02-Apr-2023 11:29:37.165 SEVERE [http-nio-8080-exec-5] org.apache.catalina.core.ApplicationContext.log ERROR: initialization failed
org.jruby.rack.RackInitializationException: Could not find rack-2.2.6.4, sinatra-3.0.5, mustermann-3.0.0, rack-protection-3.0.5, tilt-2.0.11 in locally installed gems
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:507:in materialize' from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:187:in specs'
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:244:in specs_for' from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/runtime.rb:18:in setup'
from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler.rb:161:in setup' from uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler.rb:186:in require'
from C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\config.ru:2:in block in <main>' from org/jruby/RubyBasicObject.java:2506:in instance_eval'
from org/jruby/RubyBasicObject.java:2534:in instance_eval' from uri:classloader:/vendor/rack-1.6.13/rack/builder.rb:55:in initialize'
from org/jruby/RubyClass.java:931:in new' from C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\config.ru:1:in

'

	at org.jruby.rack.RackInitializationException.wrap(RackInitializationException.java:29)
	at org.jruby.rack.RackApplicationFactoryDecorator.init(RackApplicationFactoryDecorator.java:104)
	at org.jruby.rack.RackServletContextListener.contextInitialized(RackServletContextListener.java:50)
	at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4493)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:4939)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:183)
	at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:683)
	at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:658)
	at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:662)
	at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:1023)
	at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:543)
	at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1689)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at org.apache.tomcat.util.modeler.BaseModelMBean.invoke(BaseModelMBean.java:294)
	at com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.invoke(Unknown Source)
	at com.sun.jmx.mbeanserver.JmxMBeanServer.invoke(Unknown Source)
	at org.apache.catalina.manager.ManagerServlet.check(ManagerServlet.java:1615)
	at org.apache.catalina.manager.HTMLManagerServlet.upload(HTMLManagerServlet.java:291)
	at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:209)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:528)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:596)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:209)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:190)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:53)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.catalina.filters.HttpHeaderSecurityFilter.doFilter(HttpHeaderSecurityFilter.java:126)
	at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:178)
	at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:153)
	at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:167)
	at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:90)
	at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:607)
	at org.apache.catalina.valves.RequestFilterValve.process(RequestFilterValve.java:355)
	at org.apache.catalina.valves.RemoteAddrValve.invoke(RemoteAddrValve.java:54)
	at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:130)
	at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:93)
	at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:673)
	at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74)
	at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343)
	at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:389)
	at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:63)
	at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:926)
	at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1791)
	at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1191)
	at org.apache.tomcat.util.threads.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:659)
	at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
	at java.lang.Thread.run(Unknown Source)
Caused by: org.jruby.exceptions.StandardError: (GemNotFound) Could not find rack-2.2.6.4, sinatra-3.0.5, mustermann-3.0.0, rack-protection-3.0.5, tilt-2.0.11 in locally installed gems
	at RUBY.materialize(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:507)
	at RUBY.specs(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:187)
	at RUBY.specs_for(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/definition.rb:244)
	at RUBY.setup(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler/runtime.rb:18)
	at RUBY.setup(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler.rb:161)
	at RUBY.require(uri:classloader:/META-INF/jruby.home/lib/ruby/stdlib/bundler.rb:186)
	at RUBY.<main>(C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\config.ru:2)
	at org.jruby.RubyBasicObject.instance_eval(org/jruby/RubyBasicObject.java:2506)
	at org.jruby.RubyBasicObject.instance_eval(org/jruby/RubyBasicObject.java:2534)
	at RUBY.initialize(uri:classloader:/vendor/rack-1.6.13/rack/builder.rb:55)
	at org.jruby.RubyClass.new(org/jruby/RubyClass.java:931)
	at RUBY.<main>(C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\config.ru:1)

In Tomcat:

C:\Users\Administrator>dir "C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\gems\gems"
Volume in drive C has no label.
Volume Serial Number is C683-8D31

Directory of C:\Program Files\Apache Software Foundation\Tomcat 9.0\webapps\stock-service\WEB-INF\gems\gems

04/02/2023 01:24 PM

.
04/02/2023 01:24 PM ..
04/02/2023 01:24 PM bundler-2.4.10
04/02/2023 01:24 PM mustermann-3.0.0
04/02/2023 01:24 PM rack-2.2.6.4
04/02/2023 01:24 PM rack-protection-3.0.5
04/02/2023 01:24 PM sinatra-3.0.5
04/02/2023 01:24 PM tilt-2.0.11
0 File(s) 0 bytes
8 Dir(s) 79,136,116,736 bytes free

C:\Users\Administrator>

I am new to Ruby and JRuby, I am sure I am doing something wrong, would appreciate some pointers to the right direction as I really don't know how to troubleshoot this.

Thank you

@dinosaurjunior
Copy link
Author

dinosaurjunior commented Apr 15, 2023

Hello,

I had another go at this.

I am experimenting with the following Rails project:

I am able to produce a working executable war with the following JRuby version :

  • 9.2 (2.5)
  • 9.3 (2.6.8)

If I upgrade my project to Ruby 3.1 and switch to JRuby 9.4 then i am getting this message when i run java -jar my.war:

Could not find (List of Gems here) in locally installed gems
Run bundle install to install missing gems.

Note that the project runs perfectly fine when I run it via jruby -S rails server

I couldn't find any JRuby version that supports Rails 2.7, but that's more of a JRuby issue.

I am happy to help if anyone more competent wants to look into this.

Thank you.

pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
Fix various issues when building the war.

* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
pierre added a commit to killbill/killbill-admin-ui-standalone that referenced this issue Jun 25, 2023
Fix various issues when building the war.

* Stick to Rails 6.1 for now, due to warbler compatibility issues with JRuby 9.4
  (jruby/warbler#539)
* Don't use git:// protocol in Gemfile, it won't work in the war
* Upgrade MariaDB driver
* Remove unecessary files from war
* Fix dummy_production.key permission at runtime
* Set a default secret key value
* ci: add Tomcat tests

Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
@jeremiahlukus
Copy link

jeremiahlukus commented Jun 27, 2023

Im getting the same error updating to jruby 9.4.3.0, and pulling from master

@keeguon
Copy link

keeguon commented Jul 20, 2023

Just ran into the issue, for information, running rake tasks in an executable WAR using Rails 7 and jRuby 9.4.3.0 works but as soon as you want to boot the application in a Servlet like Tomcat the issue pops up.

@jlahtinen
Copy link

We have this in our rails app in file config/warble.rb and it seems to work with warbler from master branch and with jruby 9.4.3.0

If I remember correctly this is related to #430

module FixInit
  def add_init_file(config)
    super
    if @files[config.init_filename]
      contents = @files[config.init_filename].read
      add_before = "require 'bundler/shared_helpers'"
      line_to_add = "Gem.paths = ENV\n"
      @files[config.init_filename] = StringIO.new(contents.gsub(add_before, "#{line_to_add}\\0"))
    end
  end
end

class Warbler::Jar
  prepend FixInit
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants