Unless of course, you have a fancier Rails app which has dependencies. Then, sometimes Warbler doesn't always link the proper files, and you end up with a WAR file that can't properly connect to your gems. The one I had a big problem with was RMagick. See, this one is already an issue for JRuby, since it was written in C and JRuby is in Java, and so you can't load it. I have said before though how to get around that with a little gem called rmagick4j which ports the functionality of RMagick (supposedly there are a lot of things not built yet, but I haven't had any problems).
UPDATE: You can fix this by using the warbler config:
cd /path/to/Rails/appIn the generated file config/warble.rb, find a line that goes:
jruby -S warble config
# config.gems += ["activerecord-jdbcmysql-adapter" ...Uncomment it, and add "rmagick4j" at the end of the array. This will fix the rmagick4j thing. However, feel free to keep reading, as I learned a bit of stuff from all that and you might too.
REST OF POST:
Unfortunately, the gem is not recognized from Glassfish. There is an alternative to RMagick called ImageVoodoo which you can use if you like, however I need to use RMagick because I use other gems that use RMagick (like gruff).
Here's how we fix it. First, you need to freeze the rmagick4j gem. There's a nice little thing called Gems on Rails, which freezes your gems in your Rails project folder. Install and use it like this:
jgem install gemsonrailsNow you're almost set. There's a problem with Rails. It seems to think that since we have this gem called rmagick4j in our app, that there should be a rmagick4j.rb file in the gem's folder. It's really a reasonable assumption, since that is the convention, but rmagick4j has to break the convention in order to be compatible with the original RMagick. So you have to do a little tiny hack here in order to get things working.
jruby -S rake gems:freeze GEM=rmagick4j
Create a file called rmagick4j.rb with this in it:
require File.dirname(__FILE__) + "/RMagick"
Put it in the vendor/gems/rmagick4j-0.3.6/lib folder (replace 0.3.6 with the version of rmagick4j that you have). Now you can use Warbler to package up your app, and it will work fine.