[prev in list] [next in list] [prev in thread] [next in thread] 

List:       ruby-talk
Subject:    Re: Setting to Ruby 1.9 in Ubuntu...
From:       Ken Bloom <kbloom () gmail ! com>
Date:       2010-05-02 3:08:21
Message-ID: pan.2010.04.30.21.28.21 () gmail ! com
[Download RAW message or body]

On Sat, 01 May 2010 05:22:17 +0900, Xeno Campanoli / Eskimo North and
Gmail wrote:

> Walton Hoops wrote:
>> On 4/30/2010 1:36 PM, Xeno Campanoli / Eskimo North and Gmail wrote:
>>> I tried installing a bunch of ruby 1.9 stuff on my Ubuntu laptop last
>>> night, but my default ruby is still 1.8.7.  Anybody know a regular
>>> method for setting to 1.9 on Ubuntu?  Perhaps this is an Ubuntu
>>> question, but presumably the best way is not always the Ubuntu
>>> way...???
>> The Ubuntu way is to run 'sudo update-alternatives --config ruby' and
>> 'sudo update-alternatives --config rubygems', or instead of calling
>> Ruby scripts with 'ruby', call them with 'ruby1.9' when you want them
>> run in 1.9.
>> 
>> Another solution that is available is Ruby Version Manager (RVM).  I've
>> never used RVM, so I can't say anything for or against it.
>> http://rvm.beginrescueend.com/
>> 
>> 
>> 
> Thank you.  That didn't get me there, but I really appreciate the quick
> response, and that actually helps me in some other areas.
> 
> I got this:
> 
> root@rockhopper:~# update-alternatives --config ruby
> update-alternatives: error: no alternatives for ruby. root@rockhopper:~#
> update-alternatives --config rubygems update-alternatives: error: no
> alternatives for rubygems. root@rockhopper:~#
> 
> rvm in that guise is not on my apt purvey.  I appreciate the
> suggestions. Perhaps if it's this hard it's better to wait for the OSs
> to upgrade themselves anyway.  I just noticed the CentOS we use is way
> back to ruby 1.8.5.  I sure hope we stop using CentOS soon.  It is a
> dog, and wastes a lot of our time. Debian family stuff has it's
> problems, but for my work it seems to always come out as superior.

Ubuntu (and most other distributions) believe in having a default version 
of the language, so it isn't a matter of guesswork to know which version 
of Ruby is the default. As such, interpreted language versions aren't 
managed by the alternatives system. At some time in the future, they'll 
change the default to 1.9.x (after having a well-planned migration, and 
an understanding that 1.9.x is the preffered alternative in the 
community), but in the mean time you need to specify that you want ruby 
1.9.1 by using ruby1.9.1 as your shebang, and by typing the version on 
the command line.

(They treat gcc and python similarly. Perl 5's compatibility is so set in 
stone at this point that it doesn't need alternative versions on the same 
system, so the current version is always the default.)



-- 
Chanoch (Ken) Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic