English 中文(简体)
How do I make Ruby 1.9 the default Ruby on Ubuntu?
原标题:

Is there any way, on Ubuntu 9.04, to install Ruby 1.8 as ruby1.8 (or get rid of it altogether) and have Ruby 1.9 be the default ruby?

最佳回答

I m not really sure, but maybe this can help:

update-alternatives --config ruby

... and here s the non-interactive, scriptable, way:

update-alternatives --set ruby /usr/bin/ruby1.9.1

You may find out about available alternatives and respective /usr/bin/... paths by doing:

update-alternatives --query ruby
问题回答

Martin - Take a look at the following link: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

This is where installation of ruby is heading for ubuntu servers. This should allow you to not only switch to a ruby version when needed, but also keep gems separated based on ruby versions, etc.

You can completely remove Ruby 1.8 too with:

sudo apt-get remove libruby1.8 ruby1.8 ruby1.8-dev rubygems1.8

After that, you will only have Ruby 1.9 installed.

sudo curl -L https://get.rvm.io | bash -s stable --ruby --rails

will install an up-to-date version of ruby (and rails), and allow you to avoid brokenness of Ubuntu s RVM, see https://stackoverflow.com/a/9056395/497756.

If you go this route, get rid of Ubuntu-installed versions and associated packages like bundle.

Details here: https://rvm.io/rvm/install/

(Note: this is the TL;DR version of the post by henry74.)

Try this:

sudo apt-get install ruby1.9.1 rubygems1.9.1

or try building from source. this worked for me on ubuntu 9.04 and after a restart 1.9 was the standard ruby





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签