[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Ruby or JRuby

Martin L'ecuyer

4/21/2009 2:31:00 PM

Hi i'm new here and new with Ruby. I just start to learn Ruby and Ruby
on Rails. My question is wich between Ruby or JRuby should i learn. What
the diffrence and why one and not the other one. Thanks :)
--
Posted via http://www.ruby-....

18 Answers

Charles Oliver Nutter

4/21/2009 2:38:00 PM

0

Martin L'ecuyer wrote:
> Hi i'm new here and new with Ruby. I just start to learn Ruby and Ruby
> on Rails. My question is wich between Ruby or JRuby should i learn. What
> the diffrence and why one and not the other one. Thanks :)

For learning, there's not a whole lot of difference. JRuby is almost
completely compatible with Ruby 1.8.6, so what you learn on one should
generally apply to the other.

- Charlie

James Herdman

4/21/2009 2:39:00 PM

0

[Note: parts of this message were removed to make it a legal post.]

Hi Martin.

Don't look at is as "JRuby versus Ruby", so much as two different
implementations of the same thing. I'd focus on using whichever is best
suited for your computing environment. If you have no limitations that would
prevent you from running plain old Ruby, I'd stick with that for the time
being.

James

On Tue, Apr 21, 2009 at 10:30 AM, Martin L'ecuyer <martin@g-nesia.com>wrote:

> Hi i'm new here and new with Ruby. I just start to learn Ruby and Ruby
> on Rails. My question is wich between Ruby or JRuby should i learn. What
> the diffrence and why one and not the other one. Thanks :)
> --
> Posted via http://www.ruby-....
>
>

Robert Dober

4/21/2009 2:49:00 PM

0

On Tue, Apr 21, 2009 at 4:39 PM, James Herdman <james.herdman@gmail.com> wr=
ote:
This is a tough call, I would rather learn Ruby1.9, but that will not
be such a big difference at the beginning.
When you start playing around JRuby will have the advantage that you
can test 1.8 code and 1.9 code by simply providing the --1.9 option to
the interpreter.
Installing Ruby1.8 and Ruby1.9 on the same machine is a major pain.

HTH
Robert


--=20
Si tu veux construire un bateau ...
Ne rassemble pas des hommes pour aller chercher du bois, pr=E9parer des
outils, r=E9partir les t=E2ches, all=E9ger le travail=85 mais enseigne aux
gens la nostalgie de l=92infini de la mer.

If you want to build a ship, don=92t herd people together to collect
wood and don=92t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.

--
Antoine de Saint-Exup=E9ry

David Masover

4/22/2009 8:44:00 PM

0

On Tuesday 21 April 2009 09:48:47 Robert Dober wrote:
> On Tue, Apr 21, 2009 at 4:39 PM, James Herdman <james.herdman@gmail.com>

> Installing Ruby1.8 and Ruby1.9 on the same machine is a major pain.

It really wasn't, for me. The easiest way is to simply give the executables a
suffix -- irb1.9 vs irb. And I don't know that typing "irb1.9" is harder than
"jruby --1.9".

Juan Zanos

4/22/2009 9:21:00 PM

0


On 22 avr. 09, at 16:43, David Masover wrote:

> On Tuesday 21 April 2009 09:48:47 Robert Dober wrote:
>> On Tue, Apr 21, 2009 at 4:39 PM, James Herdman
>> <james.herdman@gmail.com>
>
>> Installing Ruby1.8 and Ruby1.9 on the same machine is a major pain.
>
> It really wasn't, for me. The easiest way is to simply give the
> executables a
> suffix -- irb1.9 vs irb. And I don't know that typing "irb1.9" is
> harder than
> "jruby --1.9".
>

Probably the installation difference is minor if you just want to
learn and experiment. It's more of an issue if you seriously want
to adopt ruby 1.8 and 1.9 on many machines, different platforms, and
critical applications. Then you have to be more careful with Ruby
1.8 and 1.9. Different package managers and installers are going to
give you different snapshots. You'll want to be sure you have some
kind of system in place for managing, updating and backing off all
the different permutations so that your apps will be reliable.

If Ruby 1.8 and 1.9 source came in a version control system such that
it was quick and easy to retrieve specific versions that would
probably help a lot. Then you could try various versions without
worrying too much if there are any issues and you could probably give
good specific information about problems to ruby developers so they
can fix them.

Robert Dober

4/22/2009 10:19:00 PM

0

On Wed, Apr 22, 2009 at 10:43 PM, David Masover <ninja@slaphack.com> wrote:
> On Tuesday 21 April 2009 09:48:47 Robert Dober wrote:
>> On Tue, Apr 21, 2009 at 4:39 PM, James Herdman <james.herdman@gmail.com>
>
>> Installing Ruby1.8 and Ruby1.9 on the same machine is a major pain.
>
> It really wasn't, for me. The easiest way is to simply give the executables a
> suffix -- irb1.9 vs irb. And I don't know that typing "irb1.9" is harder than
> "jruby --1.9".


At first I thought it was a brilliant idea, so I did it but gem1.9
install bombed because it did not find gem, I do not think that I did
anything stupid.

Anyway I have opted for ruby1.9 into /usr/local/bin and jruby in my
home dir with an alias to $JRUBY_HOME/bin/jruby
and shell functions for jgem, jrake, jirb etc.

That is painless and good enough for me.

BTW I spent a day of installing and reinstalling ruby1.9 and ruby1.8
on the same machine and nothing I tried made them coexist without
*major* shell scripts for switching. As those might not scale to
changes I gave up on it, but maybe I was too tired and missed
something stupid.

Cheers
Robert

Hassan Schroeder

4/22/2009 10:31:00 PM

0

On Wed, Apr 22, 2009 at 3:19 PM, Robert Dober <robert.dober@gmail.com> wrote:

> BTW I spent a day of installing and reinstalling ruby1.9 and ruby1.8
> on the same machine and nothing I tried made them coexist without
> *major* shell scripts for switching.

?? When I have multiple versions of anything on one system, I just
install each to its own directory, and then have a file with something
like, e.g. file named ~/187

export RUBY_HOME=/usr/local/ruby1.8.7
export PATH=$RUBY_HOME/bin:$PATH

:: and then I just type '. 187' -- tickety-boo and bob's yr uncle.

Never had a problem from using that approach.

FWIW,
--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com

Joel VanderWerf

4/22/2009 10:35:00 PM

0

Robert Dober wrote:
> On Wed, Apr 22, 2009 at 10:43 PM, David Masover <ninja@slaphack.com> wrote:
>> On Tuesday 21 April 2009 09:48:47 Robert Dober wrote:
>>> On Tue, Apr 21, 2009 at 4:39 PM, James Herdman <james.herdman@gmail.com>
>>> Installing Ruby1.8 and Ruby1.9 on the same machine is a major pain.
>> It really wasn't, for me. The easiest way is to simply give the executables a
>> suffix -- irb1.9 vs irb. And I don't know that typing "irb1.9" is harder than
>> "jruby --1.9".
>
>
> At first I thought it was a brilliant idea, so I did it but gem1.9
> install bombed because it did not find gem, I do not think that I did
> anything stupid.

I've gone the '--program-suffix=19' route, just to play with ruby19, and
not had a problem, but I've avoided using gem19.

What happens if I do

gem19 install rake

for example? Well, it overwrites my old rake, and the new rake has a
hashbang line that invokes ruby19. Kaboom.

Maybe gem install should be aware of things like program-suffix in
rbconfig, and use them?

--
vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Robert Dober

4/22/2009 10:37:00 PM

0

On Thu, Apr 23, 2009 at 12:31 AM, Hassan Schroeder
<hassan.schroeder@gmail.com> wrote:
> On Wed, Apr 22, 2009 at 3:19 PM, Robert Dober <robert.dober@gmail.com> wr=
ote:
>
>> BTW I spent a day of installing and reinstalling ruby1.9 and ruby1.8
>> on the same machine and nothing I tried made them coexist without
>> *major* shell scripts for switching.
>
> ?? When I have multiple versions of anything on one system, I just
> install each to its own directory, and then have a file with something
> like, e.g. file named ~/187
>
> export RUBY_HOME=3D/usr/local/ruby1.8.7
> export PATH=3D$RUBY_HOME/bin:$PATH
>
> :: and then I just type '. 187' =A0-- tickety-boo and bob's yr uncle.
>
> Never had a problem from using that approach.
>
> FWIW,
> --
> Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
>
>
I had absolutely no problem running Ruby this way. The problem I had
is with gems.
But maybe all those approaches are sound, I am notorious for
"forgetting" things, too bad one cannot do
Test Driven Installation
R

--=20
Si tu veux construire un bateau ...
Ne rassemble pas des hommes pour aller chercher du bois, pr=E9parer des
outils, r=E9partir les t=E2ches, all=E9ger le travail=85 mais enseigne aux
gens la nostalgie de l=92infini de la mer.

If you want to build a ship, don=92t herd people together to collect
wood and don=92t assign them tasks and work, but rather teach them to
long for the endless immensity of the sea.

--
Antoine de Saint-Exup=E9ry

Robert Dober

4/22/2009 10:38:00 PM

0

On Thu, Apr 23, 2009 at 12:35 AM, Joel VanderWerf
<vjoel@path.berkeley.edu> wrote:

> Maybe gem install should be aware of things like program-suffix in rbconfig,
> and use them?
42+
R.