How do I update Ruby from 2.3.3 to 2.5.0?

Here you can discuss every aspect of Debian. Note: not for support requests!

How do I update Ruby from 2.3.3 to 2.5.0?

Postby jaytelford » 2019-07-18 20:34

I am trying to update my ruby gems on Debian 9.9, but every time I do attempt to, I get the following error.

Code: Select all
Updating installed gems
Updating did_you_mean
ERROR:  Error installing did_you_mean:
   There are no versions of did_you_mean (= 1.3.0) compatible with your Ruby & RubyGems
   did_you_mean requires Ruby version >= 2.5.0. The current ruby version is 2.3.3.222.
Gems updated: did_you_mean


I have tried to install the latest ruby version by doing sudo apt install ruby but the latest version (2.3.3) is already installed. I have tried to specify the version, but that didn't work either. is there any way at all that I can get the latest ruby version, without using version managers or 3rd party PPAs?
jaytelford
 
Posts: 33
Joined: 2018-05-09 10:56
Location: United KIngdom

Re: How do I update Ruby from 2.3.3 to 2.5.0?

Postby ruwolf » 2019-07-18 20:45

Debian 10 (currently stable) has Ruby 2.5.1...
User avatar
ruwolf
 
Posts: 392
Joined: 2008-02-18 05:04
Location: Slovakia, Banovce nad Bebravou, Matice slovenskej 1260/4-7

Re: How do I update Ruby from 2.3.3 to 2.5.0?

Postby jaytelford » 2019-07-18 22:59

ruwolf wrote:Debian 10 (currently stable) has Ruby 2.5.1...


Thanks, I have updated and everything is working again.
jaytelford
 
Posts: 33
Joined: 2018-05-09 10:56
Location: United KIngdom

Re: How do I update Ruby from 2.3.3 to 2.5.0?

Postby Thomas Reynold » 2019-10-29 06:20

Method 1: Install Ruby from Debian Repositories

The easiest way to install Ruby on your Debian system is through the apt package manager. At the time of writing, the version included in the Debian repositories is 2.3.3 which will EOL soon.

First, refresh the packages list with:

sudo apt update
Copy
Install the ruby-full package by running the following command:

sudo apt install ruby-full
Copy
Once the installation is completed, you can verify that it was successful by printing the Ruby version:

ruby --version
Copy
The output will look something like this:

ruby 2.3.3p222 (2016-11-21) [x86_64-linux-gnu]
Copy
Method 2: Install Ruby using Rbenv
Rbenv is a lightweight Ruby version management tool which allows you to easily switch Ruby versions.


By default Rbenv doesn’t handle installing Ruby versions. ruby-build is a tool that helps you to install any version of Ruby you may need. It is available as a standalone program and as a plugin for rbenv.

Install the dependencies required for the ruby-build tool to build Ruby from source:

sudo apt update
sudo apt install git curl libssl-dev libreadline-dev zlib1g-dev autoconf bison build-essential libyaml-dev libreadline-dev libncurses5-dev libffi-dev libgdbm-dev
Copy
Next, run the following curl command to install both rbenv and ruby-build scripts:

curl -sL https://github.com/rbenv/rbenv-installe ... -installer | bash -
Copy
On successful installation, the script will print something like this:


Before starting using rbenv we need to add $HOME/.rbenv/bin to our PATH.

If you are using Bash, type:

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
echo 'eval "$(rbenv init -)"' >> ~/.bashrc
source ~/.bashrc
Copy
If you are using Zsh type:

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
echo 'eval "$(rbenv init -)"' >> ~/.zshrc
source ~/.zshrc
Copy
Now that rbenv is installed on our system we can easily install the latest stable version of Ruby and set it as default version with:

rbenv install 2.5.1
rbenv global 2.5.1
Copy
Verify that Ruby was properly installed by printing the version number:

ruby -v
Copy
ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]'

Have a look on to these method. it might help :)
Thomas Reynold
 
Posts: 7
Joined: 2019-10-17 05:40

Re: How do I update Ruby from 2.3.3 to 2.5.0?

Postby trinidad » 2019-10-29 12:51

ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] is the current "full" version package for both stable (Deb 10) and oldstable (Deb 9) You may want to update rvm as well if you are now on stable as there are some newer code implementations See the link below.

https://tecadmin.net/install-ruby-on-debian/

TC
You can't believe your eyes if your imagination is out of focus.
trinidad
 
Posts: 76
Joined: 2016-08-04 14:58


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 9 guests

fashionable