--Installation of related applications --Install rbenv (version manager) --Install the specified version with rbenv --Check operation with irb
--Execute the following command
$ sudo apt-get install -y libreadline-dev
--Execute the following command
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
--Add the following to bashrc or zshrc and put it in your PATH.
export PATH=$PATH:$HOME/.rbenv/bin
--Confirm that rbenv was installed
#Reload for bash
$ source ~/.bashrc
#Reload for zsh
$ source ~/.zshrc
#Initialization
$ rbenv init
#Version confirmation
$ rbenv --version
--Execute the following command
$ rbenv install 2.7.1
$ rbenv global 2.7.1
$ ruby --version
--Finally, check if ruby works in the interactive environment.
$ irb
irb(main)> 5 + 10
=> 15
rbenv: no such command install
when trying to install the specified version with rbenvThe ruby build plugin is not installed
Execute the following command.
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
Recommended Posts