Monday, April 29, 2024
 Popular · Latest · Hot · Upcoming
30
rated 0 times [  30] [ 0]  / answers: 1 / hits: 60907  / 3 Years ago, tue, october 19, 2021, 8:21:48

Does anyone know how to properly uninstall Ruby 1.8.7 and install Ruby 1.9.2 on Ubuntu 11.10?



I have thoroughly searched and none of the tutorials I've found have worked.



Also, I spent a very long time trying to get RVM to work and it just is a pain to use. Additionally, I will have little use for the older version.



Update outputs:



which ruby:



/usr/local/bin/ruby


ls -l /usr/local/bin/ruby:



lrwxrwxrwx 1 root root 16 2011-10-17 21:20 /usr/local/bin/ruby -> /usr/bin/ruby1.8


ls -l /etc/alternatives/ruby:



lrwxrwxrwx 1 root root 18 2011-12-30 17:35 /etc/alternatives/ruby -> /usr/bin/ruby1.9.1


echo $PATH:



/usr/lib/lightdm/lightdm:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games


By the way, when I look at --config gem, it tells me that there is only one gem, which is /usr/bin/gem1.9.1


More From » ruby

 Answers
5

Is there a problem with having both installed? And using the versions from the repositories? I would install ruby 1.9.2 with:



sudo apt-get install ruby1.9.1-full


And then update the "alternatives" system to use ruby 1.9:



$ sudo update-alternatives --config ruby
There are 2 choices for the alternative ruby (providing /usr/bin/ruby).

Selection Path Priority Status
------------------------------------------------------------
* 0 /usr/bin/ruby1.8 50 auto mode
1 /usr/bin/ruby1.8 50 manual mode
2 /usr/bin/ruby1.9.1 10 manual mode

Press enter to keep the current choice
  • , or type selection number: 2
    update-alternatives: using /usr/bin/ruby1.9.1 to provide /usr/bin/ruby (ruby) in manual mode.
    $ ruby --version
    ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-linux]


  • This will also set the alternatives for erb, irb, rdoc, ri, testrb and the man page. However you need to update the gem command separately:



    $ sudo update-alternatives --config gem
    There are 2 choices for the alternative gem (providing /usr/bin/gem).

    Selection Path Priority Status
    ------------------------------------------------------------
    * 0 /usr/bin/gem1.8 180 auto mode
    1 /usr/bin/gem1.8 180 manual mode
    2 /usr/bin/gem1.9.1 10 manual mode

    Press enter to keep the current choice[*], or type selection number: 2
    update-alternatives: using /usr/bin/gem1.9.1 to provide /usr/bin/gem (gem) in manual mode.


    I know, it is confusingly called ruby1.9.1 rather than 1.9.2, some upstream debian packaging thing.


    [#41208] Wednesday, October 20, 2021, 3 Years  [reply] [flag answer]
    Only authorized users can answer the question. Please sign in first, or register a free account.
    rialhirt

    Total Points: 422
    Total Questions: 113
    Total Answers: 120

    Location: France
    Member since Sun, May 15, 2022
    2 Years ago
    rialhirt questions
    Mon, May 24, 21, 18:24, 3 Years ago
    Tue, May 10, 22, 21:43, 2 Years ago
    Thu, Feb 16, 23, 16:32, 1 Year ago
    Mon, Jun 13, 22, 03:02, 2 Years ago
    ;