Ruby version switching with rbenv

Environment

macOS Catalina 10.15.4 rbenv ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin19]

I wanted to use a newer version than the currently installed Ruby version, so switch the version with rbenv.

//Although it is written in the rbenv head family, it needs to be initialized. Bash to finish at login_Write in profile
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

//When you install rbenv, ruby-I think build was installed by dependency resolution, but I specified it just in case
$ brew install rbenv ruby-build

//List of installable versions
$ rbenv install -l
2.5.8
2.6.6
2.7.1
jruby-9.2.11.1
maglev-1.0.0
mruby-2.1.0
rbx-4.15
truffleruby-20.1.0

// install
$ rbenv install 2.7.1

//At this time, ruby's PATH via rbenv refers to the previous one. So the version at this point is 2.6.3
$ rbenv which ruby
/usr/bin/ruby

//Those who are not rbenv ruby are looking at rbenv ruby properly
$ which ruby
/Users/your_account/.rbenv/shims/ruby

//When reflecting in local (current directory)
$ rbenv local 2.7.1

//Reflected in shims
$ rbenv rehash

$ rbenv which ruby
/Users/your_account/.rbenv/versions/2.7.1/bin/ruby

that's all

Recommended Posts

Ruby version switching with rbenv
Manage the version of Ruby itself with rbenv
Install ruby on Ubuntu 20.04 with rbenv
The ruby version is managed in the .rbenv / version file
Install Ruby 3.0.0 with asdf
Getting Started with Ruby
Switching java version (memorial)
11th, Classification with Ruby
Recent problems with rbenv
Evolve Eevee with Ruby
[Ruby] How to use rbenv (version `x.x.x'is not installed)
Install rbenv with apt on ubuntu and put ruby
Correspondence when Ruby version does not switch in rbenv
Solve Google problems with Ruby
I tried DI with Ruby
GraphQL Client starting with Ruby
Ruby version does not switch
Version control Java with SDKMAN
Ruby: Send email with Starttls
Leap year judgment with Ruby
Format Ruby with VS Code
Integer check method with ruby
What to do if you installed Ruby with rbenv but the version does not change
Java version control with jenv
Rbenv command to use Ruby
Ruby Learning # 8 Working With String
Version control CocoaPods with Docker
Simplify java version switching (Mac)
[Ruby] problem with if statement
Install Ruby 3.0.0 Preview 1 with a combination of Homebrew and rbenv
Studying with CodeWar (ruby) ⑤ proc
Use Ruby with Google Colab
[Ruby] REPL-driven development with pry
Getting Started with Ruby Modules
How to deal with different versions of rbenv and Ruby
[ruby] Method call with argument
Install Ruby on MSYS2 with pacman
Make electronic music with randomness with Ruby
Ruby Scraping-Move Selenium Headless with VPS.
Installing Ruby + Rails on Ubuntu 18.04 (rbenv)
Learning Ruby with AtCoder 6 [Contest 168 Therefore]
Ruby environment construction summary ~ mac version ~
How to install ruby through rbenv
Let's use Amazon Textract with Ruby
Programming with ruby (on the way)
Studying with CodeWar (ruby) ④ case ~ when
[Grover] Generate PDF with Rails [2020 version]
[Ruby] Extracting elements with slice method
[Ruby] Handle instance variables with instance methods
Handle DatePicker with Ruby / gtk3 + glade3
Project ruby and rails version upgrade
Impressions of making BlackJack-cli with Ruby
openssl version information in ruby OPENSSL_VERSION
Make a typing game with ruby
Minimal steps to set up a Ruby environment with rbenv on Ubuntu 20.04
How to build an environment for any version of Ruby using rbenv
Template: Build a Ruby / Rails development environment with a Docker container (Ubuntu version)
Template: Build a Ruby / Rails development environment with a Docker container (Mac version)