Why not login to Qiita and try out its useful features?

We'll deliver articles that match you.

You can read useful information later.

0
1

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の環境構築

Last updated at Posted at 2020-05-10

新規アプリ作成

#Homebrewのインストール
macOS用パッケージマネージャー — Homebrew

#Homebrewのバージョン確認

brew -v

#rbenv ruby-buildのインストール

brew install rbenv ruby-build

#rbenvのバージョン確認

rbenv -v

#rbenvの設定

$ echo $SHELL

↑の実行結果に応じて次のコマンドが変わる。

実行結果が /bin/bash の場合、以下のコマンド

$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile

実行結果が /bin/zsh の場合、以下のコマンド

$ echo 'eval "$(rbenv init -)"' >>  ~/.zshrc
$ source ~/.zshrc

#インストール可能なRubyのバージョン一覧を表示

rbenv install --list

#最新のやつをインストール

このときは

rbenv install 2.6.5

#現在インストールされている Ruby を一覧で確認

rbenv versions

#使用するバージョンのRubyを指定

rbenv global 2.6.5

#Rubyのバージョンを確認

ruby -v

#Ruby on Railsをインストール

gem install rails -v "5.2.4.1"

#Railsのバージョンを確認

rails -v

これで環境構築は完了!!

0
1
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
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?