Don't load rack with jRuby on Rails

This may seem like a strange request but here’s my setup. The java
container and rack-servlet are out of my control but if you have a
recommendation towards a change other than “use a war or use the
standard
stack” please let me know.

Java Container
±----------------------------------+
| require ‘rack’ |
| square/rack-servlet https://github.com/square/rack-servlet
|
| ±------------------------------+ |
| | jRuby on Rails | |
| | - Stop rack from loading | |
| ±------------------------------+ |
±----------------------------------+

Since rack is loaded in the second level with the rack-servlet I get
“already initialized” warnings when rails finally starts. Which makes
sense
because rails is requiring it once again. Therefore how can I tell rails
to
not require rack?

I’ve tried the following in my Gemfile but it doesn’t seem to work:

Gemfile

gem ‘rack’, require: false

Warnings when I start the java container:

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:10
warning:
already initialized constant EOL

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:11
warning:
already initialized constant MULTIPART_BOUNDARY

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:12
warning:
already initialized constant MULTIPART

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:13
warning:
already initialized constant TOKEN

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:14
warning:
already initialized constant CONDISP

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:15
warning:
already initialized constant DISPPARM

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:16
warning:
already initialized constant RFC2183

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:17
warning:
already initialized constant BROKEN_QUOTED

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:18
warning:
already initialized constant BROKEN_UNQUOTED

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:19
warning:
already initialized constant MULTIPART_CONTENT_TYPE

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:20
warning:
already initialized constant MULTIPART_CONTENT_DISPOSITION

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/multipart.rb:21
warning:
already initialized constant MULTIPART_CONTENT_ID

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/utils.rb:51 warning:
already initialized constant DEFAULT_SEP

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/utils.rb:195 warning:
already initialized constant ESCAPE_HTML

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/utils.rb:204 warning:
already initialized constant ESCAPE_HTML_PATTERN

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/utils.rb:544 warning:
already initialized constant HTTP_STATUS_CODES

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/utils.rb:610 warning:
already initialized constant STATUS_WITH_NO_ENTITY_BODY

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/utils.rb:612 warning:
already initialized constant SYMBOL_TO_STATUS_CODE

vendor/bundle/jruby/1.9/gems/rack-1.5.2/lib/rack/utils.rb:625 warning:
already initialized constant Multipart

The app works fine it would just be nice to get rid of these warnings.