Help us understand the problem. What is going on with this article?

Rubyローカル環境構築:Homebrew、rbenv、ruby-buildを使った構築方法

概要

ここではHomebrewのインストールについて記載する。
内容が少し古いかもですが、作業で必要になったので、メモを兼ねて記載。

環境

Mac OS Catalina 10.15

前提

・Xcodeのインストール
・Command Line Toolsのインストール(xcode-select --install)

インストール

1.Homebrewをコマンドラインでインストールする

ターミナルで以下を記載して実行する

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
==> This script will install:
/usr/local/bin/brew
/usr/local/Library/...
/usr/local/share/doc/homebrew
/usr/local/share/man/man1/brew.1
/usr/local/share/zsh/site-functions/_brew
/usr/local/etc/bash_completion.d/brew
==> The following directories will be made group writable:
/usr/local/.
/usr/local/bin
==> The following directories will have their owner set to nakaotakahiro:
/usr/local/.
/usr/local/bin
==> The following directories will have their group set to admin:
/usr/local/.
/usr/local/bin

Press RETURN to continue or any other key to abort
==> /usr/bin/sudo /bin/chmod g+rwx /usr/local/. /usr/local/bin
Password:

Mac PCのパスワードを入力して実行する

:
:
==> Installation successful!

==> Homebrew has enabled anonymous aggregate formulae and cask analytics.
Read the analytics documentation (and how to opt-out) here:
  https://docs.brew.sh/Analytics

==> Homebrew is run entirely by unpaid volunteers. Please consider donating:
  https://github.com/Homebrew/brew#donations
==> Next steps:
- Run `brew help` to get started
- Further documentation: 
    https://docs.brew.sh

Installation successfulと表示され、インストールが成功する

2.Homebrewを最新にする

$ brew upgrade

3.rbenv、ruby-build のインストール

$ brew install rbenv ruby-build

4.Rubyのインストール

$ rbenv install 2.6.3
Downloading openssl-1.1.1b.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/5c557b023230413dfb0756f3137a13e6d726838ccd1430888ad15bfb2b43ea4b
Installing openssl-1.1.1b...
Installed openssl-1.1.1b to /Users/xxx/.rbenv/versions/2.6.3

Downloading ruby-2.6.3.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.3.tar.bz2
Installing ruby-2.6.3...
Installed ruby-2.6.3 to /Users/xxx/.rbenv/versions/2.6.3

インストール後、標準で利用するRubyのバージョンを2.6.3にする。

$ rbenv global 2.6.3

ターミナルでRubyのバージョンを確認する。

$ ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]
me-654393
Rails開発を始めました。 最近はPHP開発が多いです。
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした