Forum: Ruby on Rails Tomcat and Rails

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Zirael (Guest)
on 2007-04-17 07:08
(Received via mailing list)
I developed jsp application on Tomcat, now I decided to change this
app to Rails. I couldn't do this at ones so in the beginning I want to
serve in rails only some part of my system.
What do you think about that?
Is there anybody how has a practical experience in running Tomcat
+Mongrel?

Greetings.
Robert W. (Guest)
on 2007-04-17 07:32
(Received via mailing list)
Your only chance of running Ruby on Rails apps in Tomcat is to use
JRuby.  I hear they are getting pretty close to having JRuby far
enough along to run Rails applications.

Tomcat is a Java application server.  Ruby dosn't run in the Java JVM
unless your run JRuby.  JRuby is a Java port of Ruby and is completly
independent of the "real" Ruby (some refer to it as C Ruby, buy that's
typically only the Java guys that do that).

I've never heard of anyone running Mogrel under Tomcat.  I'm not sure
if that's even possible given that Mogrel is a Ruby based web server
with a C componet.  I doubt that it will run inside a Tomcat container
at all.
Zirael (Guest)
on 2007-04-17 08:50
(Received via mailing list)
Yes, you have right.
But I was thinking about the similar solution as in Apache+Mongrel,
And instead of Apache I want to use Tomcat.

Is anybody using Rails on JRuby in real working project?
Now I try to find some practical information about JRuby,
I wonder if I need to change sth in my original rails code.
Charles Oliver N. (Guest)
on 2007-04-17 09:01
(Received via mailing list)
On Apr 16, 10:31 pm, Robert W. <removed_email_address@domain.invalid> wrote:
> Your only chance of running Ruby on Rails apps in Tomcat is to useJRuby.  I hear they 
are getting pretty close to havingJRubyfar
> enough along to run Rails applications.

Yep, JRuby does run Rails, and you can even turn a Rails app into a
Java web archive (WAR file) and deploy it to Tomcat. There's folks
running such setups in production right now.

> Tomcat is a Java application server.  Ruby dosn't run in the Java JVM
> unless your runJRuby.  JRubyis a Java port of Ruby and is completly
> independent of the "real" Ruby (some refer to it as C Ruby, buy that's
> typically only the Java guys that do that).

We generally only call it C Ruby since our Java friends get really
confused by statements like "JRuby is an implementation of Ruby, but
it's written in Java unlike Ruby." Saying "C Ruby" helps clarify we're
talking about the implementation, not the language.

> I've never heard of anyone running Mogrel under Tomcat.  I'm not sure
> if that's even possible given that Mogrel is a Ruby based web server
> with a C componet.  I doubt that it will run inside a Tomcat container
> at all.

Mongrel can run in JRuby...the actual portion that's C code has
already been ported to Java, and we're just waiting for the release of
a JRuby-compatible Mongrel gem. But you wouldn't run it inside Tomcat,
you'd run it instead of Tomcat. Tomcat does just fine serving JRuby on
Rails without Mongrel.

- Charlie
Niels Meersschaert (Guest)
on 2007-04-17 09:50
(Received via mailing list)
JRuby is an interesting idea and does have lots of potential, but it
does add another layer of interpretation which could alter your app's
behavior.  Although there are some apps that have been successfully
deployed with it, unless there is real assurance that JRuby reacts
exactly like RealRuby®, I think the integration headache obviates the
rapid development value that Rails/Ruby brings to the table.

There is another option, which I did when I was doing J2EE/JSP work.
Use Tomcat/JBoss as your app server, but use Apache for your front
end static server.  You can then use similar load balance techniques
of Apache/Mongrel by using multiple workers (careful with this for
sessions though).

In the case of migrating from servlet/jsp to rails, you'd likely
transition over some paths to Rails (think migrating servlets to
controllers), so you have those managed by Apache forwarding to mod_jk
(tomcat) vs mod_proxy_balancer(mongrel).  Tomcat is a decent basic
webserver, but is significantly slower than Apache at serving static
pages/assets, just like Mongrel.

Niels
This topic is locked and can not be replied to.