Forum: Ruby on Rails Can RoR call java or C code

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.
(Guest)
on 2007-01-27 03:35
(Received via mailing list)
Hi
I posted this a while back but it has not yet showed up. I dont know
what happened last time.. so posting again

1. Can RoR call C or java third party code?
2. Does it support File I/O ?

thanks
Rupak
Mick S. (Guest)
on 2007-01-27 15:22
You can write extensions to the Ruby language in C to call third-party
code. RoR itself does not provide any such facilities.

You could take a look at the JRuby project. This allows Ruby to run on
top of the JVM and provides full access to the Java platform. It is not
currently mature enough to support RoR unfortunately. :(
Mick S. (Guest)
on 2007-01-27 15:23
P.S. RoR does support file I/O - but only on the server of course.
Chris T (Guest)
on 2007-01-27 19:04
(Received via mailing list)
removed_email_address@domain.invalid wrote:
>
> >
>
>
This might help:
http://www.rubyinside.com/writing-your-own-ruby-ex...
jayWHY (Guest)
on 2007-01-27 19:59
(Received via mailing list)
> 1. Can RoR call C or java third party code?

Yes.  Both.  Those aren't really features of RoR but of Ruby.  There
is a whole chapter in the Pickaxe book about extending Ruby with C.
As for Java, try RJB the Ruby Java Bridge.  In fact I just wrote a RoR
project that uses itext, a java library, via RJB.  It worked very
well.

> 2. Does it support File I/O ?

Of course.
Charles Oliver N. (Guest)
on 2007-01-27 20:13
(Received via mailing list)
On Jan 27, 7:22 am, Mick S. <removed_email_address@domain.invalid>
wrote:
> You can write extensions to the Ruby language in C to call third-party
> code. RoR itself does not provide any such facilities.
>
> You could take a look at theJRubyproject. This allows Ruby to run on
> top of the JVM and provides full access to the Java platform. It is not
> currently mature enough to support RoR unfortunately. :(

Actually JRuby does run RoR right now, but with caveats (known issues)
and it's better at 1.1.6. However we've been demoing basic Rails 1.2.1
apps running under JRuby almost weekly, and we're making a major push
over the next month to cleanup all the remaining failures.

- Charlie
This topic is locked and can not be replied to.