Wednesday, April 24, 2024
 Popular · Latest · Hot · Upcoming
5
rated 0 times [  5] [ 0]  / answers: 1 / hits: 4990  / 2 Years ago, tue, february 15, 2022, 12:40:40

I have Ruby 2.0.0 installed on Ununtu 14.04 but I can't remove Ruby 1.9.1. I replaced the /usr/bin/ruby symbolic link to ruby2.0.0, but hhen installing new gems I always get pointed to Ruby 1.9.1.



How can I definitely switch to Ruby 2.0.0?


More From » apt

 Answers
6

For Ruby, the basic dependency structure goes like this:




  1. ruby (which would ideally be a metapackage that points to the default version) depends on ruby1.9.1

  2. ruby2.0 depends on ruby



I'm not sure why they did this, or why they removed the ability to use alternatives here, but if you want to force the use of Ruby 2.0, then one non-invasive way to do this is to create symlinks to the 2.0 binaries. The snippet below will create symlinks in /usr/local/bin.



for i in erb gem irb rdoc ri ruby testrb; do
sudo ln -s /usr/bin/$i''2.0 /usr/local/bin/$i
done


Ruby 1.9.1 is still accessible by appending 1.9.1 to the binary name (for example, gem1.9.1).


[#25024] Wednesday, February 16, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ronicod

Total Points: 71
Total Questions: 111
Total Answers: 111

Location: Montenegro
Member since Fri, Dec 10, 2021
2 Years ago
;