Skip to content

Instantly share code, notes, and snippets.

@maechabin
Last active December 12, 2015 01:28
Show Gist options
  • Save maechabin/4690975 to your computer and use it in GitHub Desktop.
Save maechabin/4690975 to your computer and use it in GitHub Desktop.

RVMのインストール https://rvm.io/rvm/install/#explained

安定版のインストール

\curl -L https://get.rvm.io | bash -s stable

=== 開発版のインストール

\curl -L https://get.rvm.io | bash

マルチユーザー版のインストール

user$ \curl -L https://get.rvm.io | sudo bash -s stable

===

~/.bash_profileに追加

echo "source $HOME/.rvm/scripts/rvm" >> ~/.bash_profile

新しいターミナルを開いて、RVMをロードする

source ~/.rvm/scripts/rvm

rvmコマンド情報の先頭の1行分を表示する

type rvm | head -n 1
==> rvm is a function

オペレーティングシステムの必須条件を表示する

rvm requirements

  brew install autoconf automake apple-gcc42 libtool pkg-config openssl readline libyaml 		sqlite libxml2 libxslt libksba

既知のすべてのRubyを表示する

rvm list know

=== Ruby 1.9.3をインストールする

rvm install 1.9.3

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p374.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/maeda/.rvm/archives
Extracting yaml to /Users/maeda/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/maeda/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/maeda/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/maeda/.rvm/usr
Installing Ruby from source to: /Users/maeda/.rvm/rubies/ruby-1.9.3-p374, this may take a while depending on your cpu(s)...
ruby-1.9.3-p374 - #downloading ruby-1.9.3-p374, this may take a while depending on your connection...
ruby-1.9.3-p374 - #extracted to /Users/maeda/.rvm/src/ruby-1.9.3-p374 (already extracted)
ruby-1.9.3-p374 - #configuring
ruby-1.9.3-p374 - #compiling
Error running 'make', please read /Users/maeda/.rvm/log/ruby-1.9.3-p374/make.log
There has been an error while running make. Halting the installation.

===

Homebrew Javaのインストール Xcode Command Line Toolsのインストール

homebrewのインストール

ruby -e "$(curl -fsSkL raw.github.com/mxcl/homebrew/go)"

homebrewの確認

brew doctor
 Warning: Your Homebrew is outdated
 You haven't updated for at least 24 hours, this is a long time in brew land!

homebrewをアップデートする

brew update

homebrewのバージョンを確認する

brew -v
==> Homebrew 0.9.4

Rubyに必要なパッケージ

rvm requirements

	brew install autoconf automake apple-gcc42 libtool pkg-config openssl readline libyaml		sqlite libxml2 libxslt libksba

インストールされているパッケージを確認し、なければインストール

brew list
brew install パッケージ名

Ruby 1.9.3をインストールする

rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p374.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching yaml-0.1.4.tar.gz to /Users/maeda/.rvm/archives
Extracting yaml to /Users/maeda/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/maeda/.rvm/src/yaml-0.1.4.
Compiling yaml in /Users/maeda/.rvm/src/yaml-0.1.4.
Installing yaml to /Users/maeda/.rvm/usr
Installing Ruby from source to: /Users/maeda/.rvm/rubies/ruby-1.9.3-p374, this may take a while depending on your cpu(s)...
ruby-1.9.3-p374 - #downloading ruby-1.9.3-p374, this may take a while depending on your connection...
ruby-1.9.3-p374 - #extracted to /Users/maeda/.rvm/src/ruby-1.9.3-p374 (already extracted)
ruby-1.9.3-p374 - #configuring
ruby-1.9.3-p374 - #compiling
ruby-1.9.3-p374 - #installing 
Retrieving rubygems-1.8.25
######################################################################## 100.0%
Extracting rubygems-1.8.25 ...
Removing old Rubygems files...
Installing rubygems-1.8.25 for ruby-1.9.3-p374 ...
Installation of rubygems completed successfully.
Saving wrappers to '/Users/maeda/.rvm/bin'.
ruby-1.9.3-p374 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
ruby-1.9.3-p374 - #importing default gemsets, this may take time ...
Install of ruby-1.9.3-p374 - #complete 

一旦ターミナルを終了して、再度ログイン Rubyがインストールされているか確認

rvm list

※デフォルトに設定する場合

rvm --default 1.9.3

Ruby on Railsをインストールする

gem install rails

Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.5.0.gem (100%)
Fetching: activesupport-3.2.11.gem (100%)
Fetching: builder-3.0.4.gem (100%)
Fetching: activemodel-3.2.11.gem (100%)
Fetching: rack-1.4.4.gem (100%)
Fetching: rack-cache-1.2.gem (100%)
Fetching: rack-test-0.6.2.gem (100%)
Fetching: journey-1.0.4.gem (100%)
Fetching: hike-1.2.1.gem (100%)
Fetching: tilt-1.3.3.gem (100%)
Fetching: sprockets-2.2.2.gem (100%)
Fetching: erubis-2.7.0.gem (100%)
Fetching: actionpack-3.2.11.gem (100%)
Fetching: arel-3.0.2.gem (100%)
Fetching: tzinfo-0.3.35.gem (100%)
Fetching: activerecord-3.2.11.gem (100%)
Fetching: activeresource-3.2.11.gem (100%)
Fetching: mime-types-1.19.gem (100%)
Fetching: polyglot-0.3.3.gem (100%)
Fetching: treetop-1.4.12.gem (100%)
Fetching: mail-2.4.4.gem (100%)
Fetching: actionmailer-3.2.11.gem (100%)
Fetching: rack-ssl-1.3.3.gem (100%)
Fetching: thor-0.17.0.gem (100%)
Fetching: railties-3.2.11.gem (100%)
Fetching: rails-3.2.11.gem (100%)
Successfully installed i18n-0.6.1
Successfully installed multi_json-1.5.0
Successfully installed activesupport-3.2.11
Successfully installed builder-3.0.4
Successfully installed activemodel-3.2.11
Successfully installed rack-1.4.4
Successfully installed rack-cache-1.2
Successfully installed rack-test-0.6.2
Successfully installed journey-1.0.4
Successfully installed hike-1.2.1
Successfully installed tilt-1.3.3
Successfully installed sprockets-2.2.2
Successfully installed erubis-2.7.0
Successfully installed actionpack-3.2.11
Successfully installed arel-3.0.2
Successfully installed tzinfo-0.3.35
Successfully installed activerecord-3.2.11
Successfully installed activeresource-3.2.11
Successfully installed mime-types-1.19
Successfully installed polyglot-0.3.3
Successfully installed treetop-1.4.12
Successfully installed mail-2.4.4
Successfully installed actionmailer-3.2.11
Successfully installed rack-ssl-1.3.3
Successfully installed thor-0.17.0
Successfully installed railties-3.2.11
Successfully installed rails-3.2.11
27 gems installed
Installing ri documentation for i18n-0.6.1...
Installing ri documentation for multi_json-1.5.0...
Installing ri documentation for activesupport-3.2.11...
Installing ri documentation for builder-3.0.4...
Installing ri documentation for activemodel-3.2.11...
Installing ri documentation for rack-1.4.4...
Installing ri documentation for rack-cache-1.2...
Installing ri documentation for rack-test-0.6.2...
Installing ri documentation for journey-1.0.4...
Installing ri documentation for hike-1.2.1...
Installing ri documentation for tilt-1.3.3...
Installing ri documentation for sprockets-2.2.2...
Installing ri documentation for erubis-2.7.0...
Installing ri documentation for actionpack-3.2.11...
Installing ri documentation for arel-3.0.2...
Installing ri documentation for tzinfo-0.3.35...
Installing ri documentation for activerecord-3.2.11...
Installing ri documentation for activeresource-3.2.11...
Installing ri documentation for mime-types-1.19...
Installing ri documentation for polyglot-0.3.3...
Installing ri documentation for treetop-1.4.12...
Installing ri documentation for mail-2.4.4...
Installing ri documentation for actionmailer-3.2.11...
Installing ri documentation for rack-ssl-1.3.3...
Installing ri documentation for thor-0.17.0...
Installing ri documentation for railties-3.2.11...
Installing ri documentation for rails-3.2.11...
file 'lib' not found

=== file 'lib' not foundの対処方法

RDoc(Documentation from Ruby Source Files)をインストール

gem install rdoc

再度インストール

gem isntall rails

===

railsのバージョンを確認

rails -v

Ruby on Rails

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment