DEV Community

Andy Zhao (he/him)
Andy Zhao (he/him)

Posted on

Installing Ruby 2.5.0

I just installed Ruby 2.5.0, which was released this past Christmas (Dec 25 2017). All in all, it took about 13 minutes with no bumps in the road. Pretty great!

computer kid thumbs up meme

I only need it for the work repo, but I'm happy to have it, too. I also wasn't too sure how to go about it, and said, "Well here goes."

git pull upstream master
# pulled from repo with new Ruby version set
rbenv install 2.5.0
#=> ruby-build: definition not found: 2.5.0
#
# The following versions contain `2.5.0' in the name:
#  2.5.0-dev
#  rbx-2.5.0
#
# See all available versions with `rbenv install --list'.
#
# If the version you need is missing, try upgrading ruby-build:
#
# brew update && brew upgrade ruby-build
brew update && brew upgrade ruby-build
#=> completed with no errors
rbenv install 2.5.0
#=> Installed ruby-2.5.0
rbenv global 2.5.0
# set Ruby version for the whole machine
ruby -v
#=> ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-darwin16]
bundle install
#=> rbenv: bundle install: command not found

# The `bundle install' command exists in these Ruby versions:
#  2.3.4
gem install bundler
# 1 gem installed
bundle
# install all gems to new Ruby version needed for repo
Enter fullscreen mode Exit fullscreen mode

And that was it! Well, just for good measure, I migrated:

bin/rails db:migrate
Enter fullscreen mode Exit fullscreen mode

Hope it's as easy for you!

Top comments (7)

Collapse
 
bladefidz profile image
Hafidz Jazuli Luthfi

Thank you. Your post help me to resolve a problem in ruby on rails course

Collapse
 
andy profile image
Andy Zhao (he/him)

Awesome!

Collapse
 
bladefidz profile image
Hafidz Jazuli Luthfi

By the way, I have another problems when trying to install older version of ruby. It turn out that older versions below 2.4.x need legacy openssl version 1.0.x.

I am running at opensuse tumbleweed which most packages need openssl 1.1.x. I have tried to do bleeding edge by put libopenssl-1.0.x.so directly in /usr/lib, but rbenv keeps complaining when i want to install ruby 2.2.x.

Can you help me resolve this problem?

Thread Thread
 
andy profile image
Andy Zhao (he/him)

Ah sorry, just seeing this now... Guessing you don't need help anymore right?

Collapse
 
kellyartiaga profile image
Kelly Artiaga

Thanks!

Collapse
 
nhh profile image
Niklas

Same over here!

Best new feature is rescueing out of do-end blocks 😍 And of course yield_self 👌

Collapse
 
andy profile image
Andy Zhao (he/him)

Yeah,that's an awesome feature!