Forum: Ruby 1.9 on OS X

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.
149379873fe2cb70e550c6bff8fedd0c?d=identicon&s=25 Jeff Schwab (Guest)
on 2009-03-01 17:15
(Received via mailing list)
What is the best way to install Ruby 1.9 on Apple OS X?

The latest version in fink is 1.8.6, which I'm currently using.  I did
not see this discussion in the c.l.r archives, but please feel free to
point me to them.
3afd3e5e05dc9310c89aa5762cc8dd1d?d=identicon&s=25 Tim Hunter (Guest)
on 2009-03-01 17:41
(Received via mailing list)
Jeff Schwab wrote:
> What is the best way to install Ruby 1.9 on Apple OS X?
>
> The latest version in fink is 1.8.6, which I'm currently using.  I did
> not see this discussion in the c.l.r archives, but please feel free to
> point me to them.
>
>

Download the tarball from ruby-lang.org, configure, make, make install.

Make sure you've got /usr/local at the beginning of your $PATH, or, if
you want to use 1.9 alongside 1.8.6, use the --program-suffix= option to
append "19" to the executable names. Use "./configure --help" for more
information.
149379873fe2cb70e550c6bff8fedd0c?d=identicon&s=25 Jeff Schwab (Guest)
on 2009-03-01 17:55
(Received via mailing list)
Tim Hunter wrote:
>
> Make sure you've got /usr/local at the beginning of your $PATH, or, if
> you want to use 1.9 alongside 1.8.6, use the --program-suffix= option to
> append "19" to the executable names. Use "./configure --help" for more
> information.

Thanks.  Ordinarily, when I do that dance, I use --prefix to install
multiple versions in different directories, and to make uninstallation
feasible.

Once I have two versions installed, how do I tell (e.g.) Rails which
version to use?
E16e84e861c1815ce11ba7bd851c857d?d=identicon&s=25 lasitha (Guest)
on 2009-03-01 17:56
(Received via mailing list)
On Sun, Mar 1, 2009 at 10:09 PM, Tim Hunter <TimHunter@nc.rr.com> wrote:
> Jeff Schwab wrote:
>>
>> What is the best way to install Ruby 1.9 on Apple OS X?
> Download the tarball from ruby-lang.org, configure, make, make install.
>
> Make sure you've got /usr/local at the beginning of your $PATH, or, if you
> want to use 1.9 alongside 1.8.6, use the --program-suffix= option to append
> "19" to the executable names. Use "./configure --help" for more information.

YMMV but i had some trouble with gem executable conflicts using the
program-suffix scheme.  Also with she-bang lines in scripts.

I've had much less trouble with 1.9 in its own sandbox (e.g. under
/usr/local/ruby-1.9) and a little script to modify my $PATH whenever i
want to switch between 1.8 and 1.9.

And for the sake of completeness i should mention macports has a
ruby19 package (which installs with the aforementiond suffixes by
default).

Solidarity,
lasitha.
8a85c693f13ef7cb542ef94d2a403d4d?d=identicon&s=25 Luc Heinrich (Guest)
on 2009-03-01 19:17
(Received via mailing list)
On 1 mars 09, at 17:13, Jeff Schwab wrote:

> What is the best way to install Ruby 1.9 on Apple OS X?

MacPorts, which allows to install and use both Ruby 1.8 and Ruby 1.9
at the same time.
83ea0a95268cb5a7df095639e0ccb49c?d=identicon&s=25 Vince Angeloni (vinnie)
on 2009-03-01 20:34
Luc Heinrich wrote:
> On 1 mars 09, at 17:13, Jeff Schwab wrote:
>
>> What is the best way to install Ruby 1.9 on Apple OS X?
>
> MacPorts, which allows to install and use both Ruby 1.8 and Ruby 1.9
> at the same time.

I used MacPorts to install 1.9.1 alongside 1.8 -- totally painless. Then
if you want to use
irb with 1.9, simply type "irb19" in Terminal and you will be running
under 1.9.1. (Check
this using "RUBY_VERSION" in Terminal with irb running).

I'm not sure about Rails, but I simply altered my shebang line and Ruby
1.9.1 is
working in Textmate:

#!/opt/local/bin/ruby1.9

Macports installs ruby19 into /opt/local/bin along with a few other
files.

vince
7b00965686932462eb7c765b65c580c4?d=identicon&s=25 Arcadio Rubio garcía (abc)
on 2009-03-01 21:31
(Received via mailing list)
As already mentioned, MacPorts works fine. It gives you the option of
having separate binaries for 1.8 & 1.9 (ruby1.8 / ruby1.9, irb1.8 /
irb1.9...) or having only one (ruby, irb). But with the last option
you can't have both versions installed at the same time, although you
can activate & deactivate ports pretty fast.
This topic is locked and can not be replied to.