1
0

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 5 years have passed since last update.

rbenv (自分用チートシート)

1
Last updated at Posted at 2019-12-20

以下、CentOS7で実施

rbenv のインストール(最初だけ)

下記コマンドをひたすら打つ


$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ cd ~/.rbenv && src/configure && make -C src
$ echo 'export PATH="$HOME/.rbenv/bin:$HOME/.rbenv/shims:$PATH"' >> ~/.bash_profile
$ git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

インストールできるrubyのバージョンのリスト


$ rbenv install -l

指定バージョンのrubyインストール

(これはソースからコンパイルとかやるんで、時間かかる)


$ rbenv install 2.6.2

指定バージョンのrubyを使うとき


$ rbenv global 2.6.2
$ ruby -v #=> 現在有効なruby

インストール済みのバージョンを列挙


$ rbenv versions

インストール対象リストの更新

(※新バージョンがリリースされたときなどに、たまにやる)


$ cd "$(rbenv root)"/plugins/ruby-build && sudo git pull
1
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?