Mac occasions:
which ruby -》 / usr / bin / ruby -》 This is the ruby that comes with mac, we hope to use it to manage the ruby version.
Install rvm
curl -L https://get.rvm.io | bash -s
source ~ / .profile
Check the installation ruby conditions
rvm requirements
If status 1 is wrong.
ruby -e "$ (curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" reinstall homebrew
If the download and installation speed is very slow, you can use brew install to install the remaining packages
Install ruby, you need to tell the location of rvm openssl
?????????????? rvm install 2.0.0 --with-openssl-dir = $ HOME / .rvm / usr
Generally mac has ruby2.0.0 installed by default
Configure gem so that it does not generate documentation, rdoc and ri
subl ~ / .gemrc
Add to the file
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
Install rails
If the speed is very slow, you can change it to Taobao's gem
#View the current source gem source list
Delete a source gem source remove http://rubygems.org
#Add source, use domestic rubygems
Faster mirroring gem source add http://ruby.taobao.org/
gem install rails --version 4.0.0 -V
mac ruby rails installation (using rvm)