Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What is going on with this article?
@me-654393

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

概要

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

環境

Mac OS Catalina 10.15

前提

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

インストール

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

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

$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

==> This script will install:
/usr/local/bin/brew
/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
/usr/local/Homebrew

Press RETURN to continue or any other key to abort
==> Downloading and installing Homebrew...
HEAD is now at 8a5e32ccc Merge pull request #7663 from MikeMcQuaid/external-man
Updated 1 tap (homebrew/core).
==> Updated Formulae
imagemagick ✔    atlantis         gatsby-cli       imagemagick@6    node-sass        onnxruntime      picard-tools
acpica           evince           hlint            mu               nss              pandoc-crossref  stellar-core
==> 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
No analytics data has been sent yet (or will be during this `install` run).

==> 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のインストール

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

4.Rubyのインストールと利用設定

$ ]$ rbenv install 2.6.6
Downloading openssl-1.1.1g.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46
Installing openssl-1.1.1g...
Installed openssl-1.1.1g to /Users/mem/.rbenv/versions/2.6.6

Downloading ruby-2.6.6.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.6.tar.bz2
Installing ruby-2.6.6...
ruby-build: using readline from homebrew
Installed ruby-2.6.6 to /Users/mem/.rbenv/versions/2.6.6

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

$ rbenv global 2.6.6

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

$ ruby -v
ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-darwin19]

変更履歴

日付 内容
2020/05/31 マシン環境の変更(zshに対応)とRubyバージョン更新により、方法の一部変更
1
Help us understand the problem. What is going on with this article?
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
me-654393
Rails開発を始めました。 最近はPHP開発が多いです。

Comments

No comments
Sign up for free and join this conversation.
Sign Up
If you already have a Qiita account Login
1
Help us understand the problem. What is going on with this article?