Qiita Conference 2025

鹿野壮 (@tonkotsuboy_com)

アウトプットは最強の自己投資 〜発信が人生とキャリアを変えた話〜

157
183

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.

Rubyのバージョン変更

Last updated at Posted at 2018-01-31
  • 利用中のRubyバージョン確認
    $ ruby -v

  • インストール可能なRubyバージョン確認
    $ rbenv install --list

  • 目的のバージョンをインストール
    $ rbenv install 2.2.0

  • 現在コンソール上で利用しているRubyバージョン確認
    $ rbenv versions

  • 全体で利用するバージョンを変更
    $ rbenv global 2.2.0

  • 特定のディレクトリのみで利用するバージョンを変更
    $ rbenv local 2.2.0

  • rehashしてあげる
    $ rbenv rehash

  • rbenvのアップデート

     $ brew update
     $ brew upgrade ruby-build
     $ cd ~/.rbenv/plugins/ruby-build
     $ git pull
     $ rbenv install -list
     # => 最新のバージョンが出てくる
    
  • bundleが動かない時
    gem install bundler

追記:

プロジェクトルート直下に .ruby-version があれば、自動で読み込まれるため
rbenv local 2.2.0 は必要ないです。

# .ruby-version
2.2.0
157
183
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

Qiita Conference 2025 will be held!: 4/23(wed) - 4/25(Fri)

Qiita Conference is the largest tech conference in Qiita!

Keynote Speaker

ymrl、Masanobu Naruse, Takeshi Kano, Junichi Ito, uhyo, Hiroshi Tokumaru, MinoDriven, Minorun, Hiroyuki Sakuraba, tenntenn, drken, konifar

View event details
157
183

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?