Ruby Forum Ruby > Update latest Ruby Version 1.9 on Mac OSX

Posted by Salai Koko (koko)
on 26.03.2009 18:44
(Received via mailing list)
Dear All,

How can I Update latest Ruby Version 1.9 ?

I still use Ruby v1.8.6 version on Mac OSX 10.5.6

best regards,

Salai.
Posted by Jeremy Kemper (Guest)
on 26.03.2009 18:47
(Received via mailing list)
On Thu, Mar 26, 2009 at 10:40 AM, Thomas Khaipi <sayakyi@gmail.com> 
wrote:
> How can I Update latest Ruby Version 1.9 ?
>
> I still use Ruby v1.8.6 version on Mac OSX 10.5.6

Install it separately instead of upgrading.

Download the source and ./configure --program-suffix=19

Then you have ruby19, irb19, etc at your disposal.

jeremy
Posted by Christian (Guest)
on 26.03.2009 19:15
(Received via mailing list)
Just install MacPorts and then install 1.9
Posted by Florian Gilcher (skade)
on 26.03.2009 19:41
(Received via mailing list)
On Mar 26, 2009, at 6:42 PM, Jeremy Kemper wrote:

> Then you have ruby19, irb19, etc at your disposal.
>
> jeremy
>

The release version of Ruby 1.9 automatically configures itself to use
ruby19.

Ports is stuck at 1.9.1-preview1.

I would advice at not messing with the preinstalled version[1], as
there is a lot
of software depending on it.

Regards,
Florian

[1]: which is not hard, because it's outside of the scope where normal
*nix Software messes around.

--
Florian Gilcher

smtp:   flo@andersground.net
jabber: Skade@jabber.ccc.de
gpg:    533148E2
Posted by Luc Heinrich (Guest)
on 26.03.2009 20:46
(Received via mailing list)
On 26 mars 09, at 19:37, Florian Gilcher wrote:

> Ports is stuck at 1.9.1-preview1.


% port info ruby19
ruby19 @1.9.1-p0 (lang, ruby)
...

Try a port sync, that might help :p
Posted by Florian Gilcher (skade)
on 27.03.2009 13:20
(Received via mailing list)
On Mar 26, 2009, at 8:43 PM, Luc Heinrich wrote:

> On 26 mars 09, at 19:37, Florian Gilcher wrote:
>
>> Ports is stuck at 1.9.1-preview1.
>
>
> % port info ruby19
> ruby19 @1.9.1-p0 (lang, ruby)
> ...
>
> Try a port sync, that might help :p


Oh, the embarassment...

Regards,
Florian ;)

--
Florian Gilcher

smtp:   flo@andersground.net
jabber: Skade@jabber.ccc.de
gpg:    533148E2
Posted by Luca Reghellin (stratboy)
on 29.08.2009 15:41
Christian wrote:
> Just install MacPorts and then install 1.9

Hi! I installed ruby19 with macports (1.8.0) on Leopard, but still can't 
use ruby 1.9.

ruby -v: 1.8.6

which ruby: /usr/bin/ruby

.profile:


##
# DELUXE-USR-LOCAL-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "/usr/local/bin"
if [ $? -eq 1 ] ; then
    PATH=$PATH:/usr/local/bin
    export PATH
fi

##
# Your previous /Users/stratboy2/.profile file was backed up as 
/Users/stratboy2/.profile.macports-saved_2009-02-22_at_15:45:25
##

# MacPorts Installer addition on 2009-02-22_at_15:45:25: adding an 
appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with 
MacPorts.


# MacPorts Installer addition on 2009-02-22_at_15:45:25: adding an 
appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
# Finished adapting your MANPATH environment variable for use with 
MacPorts.

-------------------------

So, what's wrong?
Can you please help me? I'm not too good in unix/terminal...






Posted by Rick Denatale (rdenatale)
on 29.08.2009 16:11
(Received via mailing list)
On Sat, Aug 29, 2009 at 9:41 AM, Luca Reghellin<email@reghellin.com> 
wrote:
> Christian wrote:
>> Just install MacPorts and then install 1.9
>
> Hi! I installed ruby19 with macports (1.8.0) on Leopard, but still can't
> use ruby 1.9.
>
> ruby -v: 1.8.6
>
> which ruby: /usr/bin/ruby

I'm not sure because I installed Ruby 1.9 from source, but others have
said that macports installs ruby 1.1 with the suffix 19, so as not to
conflict with the base install.

If so ruby19 should get you there.

The hot ticket these days for managing multiple versions of Ruby on OS
X and Linux is the rvm gem

http://rvm.beginrescueend.com/

I haven't tried yet, but probably will look at it myself after I
finish migrating to Snow Leopard.

--
Rick DeNatale

Blog: http://talklikeaduck.denhaven2.com/
Twitter: http://twitter.com/RickDeNatale
WWR: http://www.workingwithrails.com/person/9021-rick-denatale
LinkedIn: http://www.linkedin.com/in/rickdenatale
Posted by Xavier Noria (fxn)
on 29.08.2009 16:17
(Received via mailing list)
On Sat, Aug 29, 2009 at 3:41 PM, Luca Reghellin<email@reghellin.com> 
wrote:

> Christian wrote:
>> Just install MacPorts and then install 1.9
>
> Hi! I installed ruby19 with macports (1.8.0) on Leopard, but still can't
> use ruby 1.9.
>
> ruby -v: 1.8.6
>
> which ruby: /usr/bin/ruby

I had /usr/local/bin in /etc/profile and it was being ignored after
upgrade to SL.

I've not investigated why, but by trial and error I discovered that
/etc/paths no honors order (if I am not mistaked it didn't, or the
system ignored extra entries... don't remember the exact gotcha but
there was one).

So my /etc/profile, /etc/bashrc and /etc/paths.d are system defaults
now, and just edited /etc/paths to put /usr/local/bin at the top.
Posted by Mario Camou (Guest)
on 29.08.2009 17:28
(Received via mailing list)
Note that for MacPorts it's /opt/local/bin, not /usr/local/bin.
Also, in OS X the preferred way of setting environment variables is via
.MacOS/environment.plist:
http://developer.apple.com/mac/library/qa/qa2001/qa1067.html

Hope this helps,
-Mario.

--
I want to change the world but they won't give me the source code.
Posted by Mario Camou (Guest)
on 30.08.2009 08:59
(Received via mailing list)
Add /opt/local/bin to the front of your PATH, that's where MacPorts 
stores
its binaries.

On Aug 29, 2009 3:45 PM, "Luca Reghellin" <email@reghellin.com> wrote:

Christian wrote:
> Just install MacPorts and then install 1.9

Hi! I installed ruby19 with macports (1.8.0) on Leopard, but still can't
use ruby 1.9.

ruby -v: 1.8.6

which ruby: /usr/bin/ruby

.profile:


##
# DELUXE-USR-LOCAL-BIN-INSERT
# (do not remove this comment)
##
echo $PATH | grep -q -s "/usr/local/bin"
if [ $? -eq 1 ] ; then
   PATH=$PATH:/usr/local/bin
   export PATH
fi

##
# Your previous /Users/stratboy2/.profile file was backed up as
/Users/stratboy2/.profile.macports-saved_2009-02-22_at_15:45:25
##

# MacPorts Installer addition on 2009-02-22_at_15:45:25: adding an
appropriate PATH variable for use with MacPorts.
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
# Finished adapting your PATH environment variable for use with
MacPorts.


# MacPorts Installer addition on 2009-02-22_at_15:45:25: adding an
appropriate MANPATH variable for use with MacPorts.
export MANPATH=/opt/local/share/man:$MANPATH
# Finished adapting your MANPATH environment variable for use with
MacPorts.

-------------------------

So, what's wrong?
Can you please help me? I'm not too good in unix/terminal...
Posted by Jonathan Borg (jbsan)
on 30.08.2009 10:16
Salai Koko wrote:
> Dear All,
> 
> How can I Update latest Ruby Version 1.9 ?
> 
> I still use Ruby v1.8.6 version on Mac OSX 10.5.6
> 
> best regards,
> 
> Salai.

I would use RVM (ruby version manager)

gem install rvm
then
rvm-install
and follow the instruktions, you can install multiple ruby 
implementations and switch between them on the fly
Posted by Luca Reghellin (stratboy)
on 30.08.2009 14:21
Thanks to all, I'll try each way, then post back to let you know! Thank 
you all again!
Posted by Luca Reghellin (stratboy)
on 30.08.2009 14:25
Another little question then: how do I know which ruby version is used 
by my current rails?