Forum: Ruby Setting to Ruby 1.9 in Ubuntu...

8e44b211865cd5915f2f883fd960b56d?d=identicon&s=25 Xeno Campanoli / Eskimo North and Gmail (Guest)
on 2010-04-30 21:37
(Received via mailing list)
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...???
333f4732df72b5fd7002b61e2304def4?d=identicon&s=25 Walton Hoops (vyper)
on 2010-04-30 21:57
(Received via mailing list)
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/
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2010-04-30 22:20
(Received via mailing list)
On Apr 30, 2010, at 3:57 PM, Walton Hoops wrote:

> never used RVM, so I can't say anything for or against it.
> http://rvm.beginrescueend.com/
>

Forget Ubuntu's ruby completely. Use RVM, you will save yourself TONS of
headache. It's really easy:

sudo gem install rvm
rvm-install (and follow instructions for .bashrc settings)

rvm install 1.9.1
rvm use 1.9.1 --default

Now you're completely in the RVM system (which is maintained in ~/.rvm
by default) and can trivially switch between a myriad of Ruby
implementation.

Jason
Ff9e18f0699bf079f1fc91c8d4506438?d=identicon&s=25 James Britt (Guest)
on 2010-04-30 22:21
(Received via mailing list)
Walton Hoops wrote:
> never used RVM, so I can't say anything for or against it.
> http://rvm.beginrescueend.com/

Or install from source code.

I'm not a fan of Ubuntu's packaging of Ruby, though for some apps (such
as Amarok) you seem to have to have it.  (nice that they have it
scriptable by Ruby, stupid that you can't specify *which* ruby you want
it to use.)


rvm is quite slick and I've been using it on some recent machine builds.


--
James Britt

www.jamesbritt.com           - Playing with Better Toys
www.ruby-doc.org             - Ruby Help & Documentation
www.rubystuff.com            - The Ruby Store for Ruby Stuff
www.neurogami.com            - Smart application development
8e44b211865cd5915f2f883fd960b56d?d=identicon&s=25 Xeno Campanoli / Eskimo North and Gmail (Guest)
on 2010-04-30 22:23
(Received via mailing list)
Walton Hoops wrote:
> 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.
8e44b211865cd5915f2f883fd960b56d?d=identicon&s=25 Xeno Campanoli / Eskimo North and Gmail (Guest)
on 2010-04-30 22:37
(Received via mailing list)
Jason Roelofs wrote:

root@rockhopper:~# gem install rvm
********************************************************************************

   In order to setup rvm for your user's environment you must now run
rvm-install.
   rvm-install will be found in your current gems bin directory
corresponding to
where the gem was installed.

   rvm-install will install the scripts to your user account and append
itself
to your profiles in order to
   inject the proper rvm functions into your shell so that you can
manage
multiple rubies.

********************************************************************************
Successfully installed rvm-0.1.27
1 gem installed
Installing ri documentation for rvm-0.1.27...
Installing RDoc documentation for rvm-0.1.27...
root@rockhopper:~# rvm install 1.9.1
No command 'rvm' found, but there are 20 similar ones
rvm: command not found
root@rockhopper:~# which rvm
root@rockhopper:~#
83ca41657a99b65d99889abe712ba5e2?d=identicon&s=25 Jason Roelofs (Guest)
on 2010-04-30 22:57
(Received via mailing list)
You didn't follow the instructions I gave and the block of text there
gave you.

rvm-install

And there will be some bash commands to add to your .bashrc as well,
which rvm-install gives you.

Jason
333f4732df72b5fd7002b61e2304def4?d=identicon&s=25 Walton Hoops (vyper)
on 2010-04-30 23:36
(Received via mailing list)
On 4/30/2010 2:36 PM, Xeno Campanoli / Eskimo North and Gmail wrote:
>
> Installing RDoc documentation for rvm-0.1.27...
> root@rockhopper:~# rvm install 1.9.1
> No command 'rvm' found, but there are 20 similar ones
> rvm: command not found
> root@rockhopper:~# which rvm
> root@rockhopper:~#
>

This is because the location that Debian/Ubuntu's version of rubygems
puts gem executable is not in your path by default, one of many problems
you avoid if you install from source.  I don't recall where Debian dumps
them off the top of my head, but I'll check when I get home. That said,
I _highly_ recommend installing from source instead of using Ubuntu's
version.  You avoid several headaches that way.
8e44b211865cd5915f2f883fd960b56d?d=identicon&s=25 Xeno Campanoli / Eskimo North and Gmail (Guest)
on 2010-04-30 23:39
(Received via mailing list)
Jason Roelofs wrote:

Sorry man.  The more I play with this thing, the less comfortable I feel
about
it.  If I had time to help with it, I would be glad to.  Not today.

Sincerely, Xeno
333f4732df72b5fd7002b61e2304def4?d=identicon&s=25 Walton Hoops (vyper)
on 2010-04-30 23:40
(Received via mailing list)
On 4/30/2010 2:22 PM, Xeno Campanoli / Eskimo North and Gmail wrote:
>> in 1.9.
> I got this:
> 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.
>
Ugh.  I just assumed that Ruby would be managed through the
alternatives.  This is why I run from source.

The lazy man's solution to your problem is to simply change the symbolic
link 'ruby' in /usr/bin to point to 'ruby1.9' instead of 'ruby1.8' (the
same would need to be done for rubygems.  Make sense?
A4e17f895c60ea54a1bd18dcac4df649?d=identicon&s=25 Jonathan Nielsen (Guest)
on 2010-04-30 23:43
(Received via mailing list)
Try 'sudo gem install rvm'

This will put the rvm-install in your path.

-Jonathan Nielsen
8e44b211865cd5915f2f883fd960b56d?d=identicon&s=25 Xeno Campanoli / Eskimo North and Gmail (Guest)
on 2010-04-30 23:46
(Received via mailing list)
Walton Hoops wrote:
>> corresponding to where the gem was installed.
>> Installing ri documentation for rvm-0.1.27...
> you avoid if you install from source.  I don't recall where Debian dumps
> them off the top of my head, but I'll check when I get home. That said,
> I _highly_ recommend installing from source instead of using Ubuntu's
> version.  You avoid several headaches that way.
>
>

Yes, you know in some settings I really want to stay with a simple set
of
repeatable and well known standards.  I need to wait on 1.9 I think
until it
actually 'comes out' for this project.  Thanks again.
333f4732df72b5fd7002b61e2304def4?d=identicon&s=25 Walton Hoops (vyper)
on 2010-05-01 00:24
(Received via mailing list)
On 4/30/2010 3:42 PM, Jonathan Nielsen wrote:
> Try 'sudo gem install rvm'
>
> This will put the rvm-install in your path.
>
> -Jonathan Nielsen
>

No it won't, he's installed the Debian version of rubygems, which puts
the gem executables in /var/lib/gems/<version>/bin, which is not in the
default path. It can, however be added by putting:

export PATH=/var/lib/gems/1.8/bin:$PATH
at the end of ~./bashrc
A4e17f895c60ea54a1bd18dcac4df649?d=identicon&s=25 Jonathan Nielsen (Guest)
on 2010-05-01 00:40
(Received via mailing list)
>
> No it won't, he's installed the Debian version of rubygems, which puts
> the gem executables in /var/lib/gems/<version>/bin, which is not in the
> default path. It can, however be added by putting:
>
> export PATH=/var/lib/gems/1.8/bin:$PATH
> at the end of ~./bashrc
>

Well, that's precisely what I did on mine to install rvm atop Ubuntu's
ruby+rubygems, and it put rvm-install in /usr/bin... on Ubuntu 9.10 at
least.

That's all I use the Ubuntu packaged ruby for - installing rvm so I
can mess around with different ruby versions :)

-Jonathan Nielsen
851acbab08553d1f7aa3eecad17f6aa9?d=identicon&s=25 Ken Bloom (Guest)
on 2010-05-02 05:08
(Received via mailing list)
On Sat, 01 May 2010 05:22:17 +0900, Xeno Campanoli / Eskimo North and
Gmail wrote:

>> run in 1.9.
> I got this:
> 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.)
Please log in before posting. Registration is free and takes only a minute.
Existing account

NEW: Do you have a Google/GoogleMail, Yahoo or Facebook account? No registration required!
Log in with Google account | Log in with Yahoo account | Log in with Facebook account
No account? Register here.