# Do you recommend deploying Rails applications as WARs?

**URL:** <https://www.ruby-forum.com/t/do-you-recommend-deploying-rails-applications-as-wars/184303>\
**Category:** Ruby\
**Created:** [February 28, 2010, 4:15pm UTC](https://www.ruby-forum.com/t/do-you-recommend-deploying-rails-applications-as-wars/184303 "2010-02-28T16:15:55Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 28, 2010, 4:15pm UTC](https://www.ruby-forum.com/t/do-you-recommend-deploying-rails-applications-as-wars/184303/1 "2010-02-28T16:15:55Z")

</div>

Hey,  
Does deploying Rails application via JRuby on Java web container has  
any disadvantages?  
IMHO, I think deploying Rails applications as WAR is best approach and  
the most comforting one.  
What do you think?  
Thanks.

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 28, 2010, 6:10pm UTC](https://www.ruby-forum.com/t/do-you-recommend-deploying-rails-applications-as-wars/184303/2 "2010-02-28T18:10:38Z")

</div>

On Sun, Feb 28, 2010 at 8:15 AM, Hussein B [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hey,  
> Does deploying Rails application via JRuby on Java web container has  
> any disadvantages?  
> IMHO, I think deploying Rails applications as WAR is best approach and  
> the most comforting one.

We’re deploying on JBoss with warbler (JBoss 4.x on Java 5, so we can’t  
use  
TorqueBox). I think it’s a great solution when you’re dealing with a  
separate deployment team with Java experience but no Ruby experience.  
Just  
hand them a WAR file and… done!

One of the big issues we’ve run into is accessing the outside  
filesystem.  
Right now we’re using JBoss-specific APIs to do that, and can only  
access  
files within the JBoss CLASSPATH. This is fine for reading files from  
the  
external filesystem, but AFAICT if you need to write to the outside  
filesystem you’re SOL. Maybe there’s someone else who knows more about  
that.

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 28, 2010, 6:49pm UTC](https://www.ruby-forum.com/t/do-you-recommend-deploying-rails-applications-as-wars/184303/3 "2010-02-28T18:49:51Z")

</div>

On Sun, Feb 28, 2010 at 9:10 AM, Tony A. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Sun, Feb 28, 2010 at 8:15 AM, Hussein B [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Does deploying Rails application via JRuby on Java web container has  
> > any disadvantages?

Yes. For one thing, you can’t use gems/plugins with native code; that  
may or may not be an issue for you. And the whole thing just “feels”  
heavier to me. YMMV.

> > IMHO, I think deploying Rails applications as WAR is best approach and  
> > the most comforting one.

There are some cases where it’s necessary, so it’s good that it’s  
an option (and admittedly getting easier).

> We’re deploying on JBoss with warbler (JBoss 4.x on Java 5

> One of the big issues we’ve run into is accessing the outside filesystem.  
> Right now we’re using JBoss-specific APIs to do that, and can only access  
> files within the JBoss CLASSPATH. This is fine for reading files from the  
> external filesystem, but AFAICT if you need to write to the outside  
> filesystem you’re SOL.

Are you sure that’s not a Java security manager issue?

We’ve run our app on OC4J, Tomcat, and Glassfish (v3), and haven’t  
ever had any issue with writing files (saving avatar images, etc.).

---

<div class="post-metadata">

**Author:** ![Hussein\_B](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/h/a4c791/32.png) [@Hussein\_B](https://www.ruby-forum.com/u/Hussein_B)\
**Post date:** [February 28, 2010, 9:11pm UTC](https://www.ruby-forum.com/t/do-you-recommend-deploying-rails-applications-as-wars/184303/4 "2010-02-28T21:11:28Z")

</div>

On Sun, Feb 28, 2010 at 10:48 AM, Hassan S. \<  
removed\_email\_address@domain.invalid\> wrote:

> Yes. For one thing, you can’t use gems/plugins with native code; that  
> may or may not be an issue for you.

A small correction: you can use native code so long as the gem in  
question  
is written with FFI (e.g. Nokogiri)

That said, you’ll probably want to avoid this if possible as well, as it  
takes you away from the seamlessness of a pure Java deployment.
