LoginSignup
0

More than 3 years have passed since last update.

rbenvでRuby自体のVersion管理をする

Last updated at Posted at 2020-08-05

これは何?

Rubyのインストール時にVersion管理ツール経由でインストールするときのメモです。Ubuntuでのインストールで説明しています。

手順

rbenvをインストールする

$ sudo apt-get update
$ cd
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc
$ git clone https://github.com/rbenv/ruby-build.git ~/.rbenv/plugins/ruby-build
$ echo 'export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"' >> ~/.bashrc
$ source ~/.bashrc

Rubyをインストール

好みのVersionを指定してインストールして、そのVersionを使うように指定する。

$ rbenv install -l
$ rbenv install 2.7.1
$ rbenv global 2.3.1

bundlerをインストールする

$ gem install bundler
$ rbenv rehash

bundleのパッケージをインストールする

$ bundle install

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
What you can do with signing up
0