0

I have run the code:

sudo apt-get install ruby 2.5.0

then:

update-alternatives --query ruby

which throws error:

update-alternatives: error: no alternatives for ruby

I also used the code:

wget http://ftp.ruby-lang.org/pub/ruby/2.5/ruby-2.5.3.tar.gz
tar -xzvf ruby-2.5.3.tar.gz
cd
cd ruby-2.5.3/
./configure
make
sudo make install

but this too didn't work as when I run this code to check the version:

ruby -v

it shows the previous version i.e. ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-linux]

this question is repeated but the other solutions didn't work for me. Any suggestion or help will be appreciated.

spd_25
  • 1
  • 1
  • 2
  • 1
    "sudo apt-get install ruby 2.5.0" is not valid code. It would try to install a package called "ruby" and a package called "2.5.0". Please show exactly what you have tried and what output you got. What other solutions did not work? – slhck Jan 16 '19 at 11:38
  • this is what was mentioned and I have tried, can you please specify the correct code – spd_25 Jan 16 '19 at 13:52
  • Possible duplicate of [How to install the latest version of Ruby and Ruby on Rails in Ubuntu?](https://superuser.com/questions/291693/how-to-install-the-latest-version-of-ruby-and-ruby-on-rails-in-ubuntu) – slhck Jan 16 '19 at 14:34
  • 1
    You didn't say where that was mentioned. Either way I recommend using `rbenv` or RVM to install a current Ruby. – slhck Jan 16 '19 at 14:35
  • [link] (How to install the latest version of Ruby and Ruby on Rails in Ubuntu?) -this too didn't work for me. – spd_25 Jan 16 '19 at 15:11
  • "this didn't work" is not a proper error description. Please show *exactly* what you have tried and what happened as a result. We're not sitting in front of your computer, so we cannot guess what the problem is. Please have a look at https://stackoverflow.com/help/how-to-ask and [edit] your post with more info. – slhck Jan 16 '19 at 15:37
  • @slhck This is the best way to handle this. Don’t attempt to update the core system Ruby but instead use [RVM](https://rvm.io) or [rbenv](https://devhints.io/rbenv). Anything else is a pain to manage at best, headache at worst. – Giacomo1968 Jan 16 '19 at 16:28
  • While installing it through RVM it throws an error `'RVM is not a function, selecting rubies with 'rvm use ...' will not work.'` though I have checked the 'Run command as login shell' – spd_25 Jan 16 '19 at 17:31
  • See https://stackoverflow.com/questions/9336596/rvm-installation-not-working-rvm-is-not-a-function, but please remember to look for these kinds of errors and see if there is a solution already available online. – slhck Jan 16 '19 at 18:05
  • @spd_25 Sounds like you have environment path issues. – Giacomo1968 Jan 17 '19 at 21:08
  • the ruby -v command gives the following output:ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] – spd_25 Jan 18 '19 at 07:37

0 Answers0