This is the error that I am getting when deploying my Ruby on Rails web application (with Jetty):
2012-07-17 13:11:25,595,INFO,service.nav.server - An exception happened during JRuby-Rack startup
Could not find root path for #<Usermanagement::Engine:0x302abefe>
--- Backtrace
RuntimeError: Could not find root path for #<Usermanagement::Engine:0x302abefe>
find_root_with_flag at file:/tmp/Jetty_0_0_0_0_2525_ui.0.0.1.SNAPSHOT.war____d9z055/webapp/WEB-INF/lib/gems.jar!/gems/railties-3.1.3/lib/rails/engine.rb:599
config at file:/tmp/Jetty_0_0_0_0_2525_ui.0.0.1.SNAPSHOT.war____d9z055/webapp/WEB-INF/lib/gems.jar!/gems/railties-3.1.3/lib/rails/engine.rb:479
railties at file:/tmp/Jetty_0_0_0_0_2525_ui.0.0.1.SNAPSHOT.war____d9z055/webapp/WEB-INF/lib/gems.jar!/gems/railties-3.1.3/lib/rails/engine.rb:423
initializers at file:/tmp/Jetty_0_0_0_0_2525_ui.0.0.1.SNAPSHOT.war____d9z055/webapp/WEB-INF/lib/gems.jar!/gems/railties-3.1.3/lib/rails/engine.rb:473
....
Usermanagement is a locally built gem in the form of a Rails Engine. It is an isolated mountable engine – Usermanagement being the isolated namespace. The gem is built with Rails 3.1.3
Checked the gems.jar file in the built WAR and the usermanagement gem is there, as well as it’s required stuff like the config directory and lib directory.
I’m having troubles finding a specific commit that makes this break. It seems more like it might be an environment issue.
Any advice is welcome!
So apparently, this error was actually being caused by having .class files included in the Usermanagement gem.
Due to permission requirements on our build server, we had the build process installing gems to a local folder – i.e.
project-name/gems/gemsThis was all good and fine, however, then Warbler is being used to build the war file, and Warbler creates class files from all
.rbfiles which it finds in the project directory – BEFORE creating the gems.jar file. Thus, we ended up with.classfiles inside thegems.jararchive.I am somewhat still at a loss as to why having the class files breaks everything – however, not having them does fix everything 🙂
Solution
Told Warbler to not include the
gemsdirectory in the webapp: (in warbler.rb)