# Rack and Tomcat can't find gem

**URL:** <https://www.ruby-forum.com/t/rack-and-tomcat-cant-find-gem/163864>\
**Category:** Deployment\
**Created:** [March 25, 2009, 4:54pm UTC](https://www.ruby-forum.com/t/rack-and-tomcat-cant-find-gem/163864 "2009-03-25T16:54:31Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![paul-au](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/f475e1/32.png) [@paul-au](https://www.ruby-forum.com/u/paul-au)\
**Post date:** [March 25, 2009, 4:54pm UTC](https://www.ruby-forum.com/t/rack-and-tomcat-cant-find-gem/163864/1 "2009-03-25T16:54:31Z")

</div>

Hello, I’ve been struggling for awhile now trying to get my sample rails  
app to run on Tomcat. I’m using JRuby in conjunction with Warbler to  
create my war file.

I’m using jruby 1.1.6, warbler 0.9.12, rails 2.1.0, Tomcat 5.5.27 (which  
is the target version for my real Rails app to be deployed on), JDK 1.6  
and running this on Ubuntu 8.10.

I was just trying to get a very simple rails app (assign a string in a  
controller and output its value in a view), make the war and deploy.  
All the examples online looked like this should be a piece of cake.

Made my war (warble war), built my war file just fine. Dropped said war  
file in the webapps directory, started tomcat, default location came up  
fine, showed the Rails homepage, went to access my controller and I get  
a 500 error.

In the localhost log I see the following:

SEVERE: Exception caught  
org.jruby.rack.RackInitializationException: Could not find RubyGem  
activesupport (\>= 0)

from  
file:/usr/local/tomcat/webapps/sample\_app/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:46:in  
`require_frameworks_with_servlet_env' from /usr/local/tomcat/webapps/sample_app/WEB-INF/config/../vendor/rails/railties/lib/initializer.rb:113:in`process’  
from  
/usr/local/tomcat/webapps/sample\_app/WEB-INF/config/…/vendor/rails/railties/lib/initializer.rb:93:in  
`run' from /usr/local/tomcat/webapps/sample_app/WEB-INF/config/environment.rb:13 from /usr/local/tomcat/webapps/sample_app/WEB-INF/config/environment.rb:29:in`load’  
from  
file:/usr/local/tomcat/webapps/sample\_app/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:29:in  
`load_environment' from file:/usr/local/tomcat/webapps/sample_app/WEB-INF/lib/jruby-rack-0.9.3.jar!/jruby/rack/rails.rb:152:in`new’  
from :3  
from  
file:/usr/local/tomcat/webapps/sample\_app/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in  
`instance_eval' from file:/usr/local/tomcat/webapps/sample_app/WEB-INF/lib/jruby-rack-0.9.3.jar!/rack/builder.rb:22:in`initialize’  
from :3

I checked the gems I had installed, seems I was missing that one, so I  
added it (jruby -S gem install … ) and found it was there then.  
Restarted Tomcat, same error.

So my question is, can Tomcat not find these? Do I need to set an  
environment variable somewhere so that Tomcat can see my gem library?  
I’ve tried editing the warble.rb file in my app but any changes I seem  
to make in there still results in the same log entry.

Any help or suggestions would be greatly appreciated!
