LoginSignup
6
5

More than 5 years have passed since last update.

Homebrewをインストール - Node.jsとRubyの環境構築(1)

Last updated at Posted at 2015-06-19

Web制作において欠かせなくなってきているNode.jsとRubyの環境を構築する方法を、3回にわたってご紹介します。

Node.jsとRubyの環境構築
1. Homebrewをインストール
2. nodebrewでNode.jsをバージョン管理
3. rbenvでRubyをバージョン管理

下準備

不可視ファイルの表示

不可視ファイルとは、誤って消してしまったりしないように通常は非表示なっているファイルのことです。ファイル名は、"."(ドット)から始まります。今回は不可視ファイルを操作するので、不可視ファイルをFinderで見れるように設定します。

「ターミナル.app」を起動し、以下のコマンドを入力します。

$ defaults write com.apple.finder AppleShowAllFiles -boolean true

Finderを再起動するコマンドを入力します。

$ killall Finder

これで不可視ファイル(不可視フォルダ)がFinderで表示されるようになります。

Homebrewのインストール

Homebrew.png

インストール

以下のコマンドを入力して、Homebrewをインストールします。

$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Homebrewがインストールできたかを確認します。

$ brew doctor

これでYour system is ready to brew.と表示されればOKです。

環境設定

ユーザのホームディレクトリに.bash_profileが無ければ、作成します。

$ touch ~/.bash_profile

.bash_profileを「テキストエディット.app」で開いて、以下の内容を書き込みます。

.bash_profile
export PATH=/usr/local:$PATH

.bash_profileを再読み込みします。

$ source ~/.bash_profile

参考サイト

「Node.jsとRubyの環境構築」バックナンバー

  1. Homebrewをインストール
  2. nodebrewでNode.jsをバージョン管理
  3. rbenvでRubyをバージョン管理
6
5
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
6
5