1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Rubyバージョン変更】Docker環境でrbenv, ruby-buildをインストールする

Last updated at Posted at 2020-04-27

はじめに

 Dockerで開発していく中でrubyのバージョン変更する必要が出て来たのでrbenv, ruby-buildをインストールしてrubyのバージョン変更を行う

rbenvをインストール

/bin/bashでrbenvをcloneしてくる


git clone https://github.com/rbenv/rbenv.git

パスを通す


echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
source ~/.bash_profile

ruby-buildをインストール

ruby-buildをcloneする


git clone https://github.com/rbenv/ruby-build.git

rubyインストール

バージョン確認してrubyをインストールする

rbenv install -l
rbenv install 2.5.5
rbenv rehash

終わりに

Dockerfileを書くときに追加しておけば楽だった

1
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?