Forum: Ruby on Rails Rails and JRuby

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.
Bb4bdf2b184027bc38d4fb529770cde5?d=identicon&s=25 Wes Gamble (weyus)
on 2006-03-21 20:15
Has anyone attempted to run Rails inside of JRuby?

Is that even possible?

Aside from the performance implications, is it a bad idea?

I'm thinking that it might be useful in very rare cases where a
Ruby/Rails - equivalent of a Java solution may not exist yet.

Any thoughts?

Wes
7b8adabc68bcdcf2df5ea4a8441cecc4?d=identicon&s=25 Colin (Guest)
on 2006-03-21 20:38
JRuby isn't a complete Ruby implementation. It won't work. Apart from
other things using c libraries is not possible.

It's better to use http://raa.ruby-lang.org/project/rjb/ as a bridge if
you need to use java whiting Ruby.
526d60de6472502bb570a9df2842b33b?d=identicon&s=25 Nick Sieger (Guest)
on 2006-03-21 21:10
(Received via mailing list)
On 3/21/06, Wes Gamble <weyus@att.net> wrote:
>
> Has anyone attempted to run Rails inside of JRuby?


Yes, it's currently being worked on by the JRuby maintainers.  Jump over
to
the JRuby lists at http://sourceforge.net/mail/?group_id=35413 for
details.
See also recent posts at http://headius.blogspot.com.

Is that even possible?


Not yet, but the plan is to have something to demo by JavaOne this year.

Aside from the performance implications, is it a bad idea?


I personally don't think so -- on the contrary, a solid implementation
of
Ruby on the JVM would do wonders for Ruby adoption across the huge
installed
base of Java and JVMs.  For people accustomed to Java-based webapp
deployments (like me), the idea of running Rails in a Java environment
is
staggering and liberating.

Cheers,
/Nick
Eea7ad39737b0dbf3de38874e0a6c7d8?d=identicon&s=25 Justin Forder (Guest)
on 2006-03-22 02:58
(Received via mailing list)
Nick Sieger wrote:
> environment is staggering and liberating.
+1

   Justin
4005a47a8f2ceee49670b920593c1d52?d=identicon&s=25 Ben Munat (Guest)
on 2006-03-22 05:13
(Received via mailing list)
Nick Sieger wrote:
> installed base of Java and JVMs.  For people accustomed to Java-based
> webapp deployments (like me), the idea of running Rails in a Java
> environment is staggering and liberating.

Yeah, so I can have my servlet container.... waaaaaa!

b
F1d37642fdaa1662ff46e4c65731e9ab?d=identicon&s=25 Charles O Nutter (Guest)
on 2006-03-30 08:35
(Received via mailing list)
Thank you Nick for catching this...I need to start filtering to catch
"JRuby" emails on the Rails list too :)

We are working feverishly right now to get Rails working on JRuby by
mid-may, for our JavaOne presentation. I can give a brief status update
here:

What works:

- script/generate runs, with all the base generators in 1.0. I have not
done
a comparison, but it appears to be generating correct code and
configuration. Considering that generate loads up a substantial portion
of
Rails, we're pretty happy that this runs successfully now.
- some other scripts in /script run, but we have not done a lot of
additional testing

What doesn't work:

- Actually handling a rails request (i.e. through dispatch.cgi) gets
pretty
far, but it's still bombing out due to interpreter issues or missing
functionality in JRuby. We believe that we're pretty close, however.

How it will work:

We will probably create a "CGI Servlet" that primes JRuby's environment
such
that Rails can run out-of-the-box. This should allow anyone to take a
typical Rails app and a given Rails release, JAR them up in an
appropriate
way, and deploy them to your application server of choice. Our emphasis
is
to first make Rails run exactly as it does today, without requiring any
unnecessary modification or special configuration (following the Rails
mentality).

Eventually we would also like to provide seamless support for Rails to
use
J2EE services as though they were Rails equivalents. For example
ActiveRecord adapters to JDBC, remote services in EJBs or Web Service
mapped
appropriately into the Rails world, JTA transaction management,
clustering,
failover, the ability to use JSPs for Rails presentation (such that
existing
apps with extensive existing UIs could be "half-ported" to Rails right
away), and so on. Anything you do in J2EE could be mapped into its much
more
consumable Rails equivalent.

We're very excited about the possibilities of JRuby on Rails, and we
hope it
will help make Rails a viable option for all those Java-only shops out
there.
58213d4c1552914aaa20e9cab0010149?d=identicon&s=25 David N. Welton (Guest)
on 2006-03-30 09:26
(Received via mailing list)
Charles O Nutter wrote:

> What doesn't work:
>
> - Actually handling a rails request (i.e. through dispatch.cgi) gets pretty
> far, but it's still bombing out due to interpreter issues or missing
> functionality in JRuby. We believe that we're pretty close, however.

Interesting - what's missing?

--
David N. Welton
- http://www.dedasys.com/davidw/

Linux, Open Source Consulting
- http://www.dedasys.com/
F1d37642fdaa1662ff46e4c65731e9ab?d=identicon&s=25 Charles O Nutter (Guest)
on 2006-03-30 20:00
(Received via mailing list)
The "missing" features have ranged from bugs in the interpreter (for
example, classes not being created with the correct nesting or scope) to
Java's inability (pre-1.5) to access environment variables (which makes
running a JRuby on Rails "test CGI" impossible). We're adding everything
that's missing right now, with a run, debug, fix cycle. Most of the
recent
issues have been minor things missing from JRuby's core Ruby libraries,
which are usually easy to add.
This topic is locked and can not be replied to.