[ruby on rails]rails安装

准备(Mac用户先做这些工作,unix用户跳过)

  • 安装系统需要的包
# For Mac 
# 先安装 [Xcode](http://developer.apple.com/xcode/) 开发工具,它将帮你安装好 Unix 环境需要的开发包, app store 里下载 xcode.app, 安装完成后运行, 在设置中的 Downloads 里安装 Command Line Tools
# 然后安装 [Homebrew](http://brew.sh)
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

  • 安装 Rails 必要的一些三方库
$ brew install libxml2 libxslt libiconv

1. rvm安装

$ gpg2 --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB
$ curl -sSL https://get.rvm.io | bash -s stable
curl -sSL https://get.rvm.io | bash -s 1.27.0 #安装ruby2.3时候用rvm1.27.0不会报错

 #这个时候国内可能会显示Failed connect to raw.githubusercontent.com:443; 拒绝连接, 解决方案:vi /etc/hosts ,加入199.232.68.133 raw.githubusercontent.com , 这个真实ip可在https://www.ipaddre

Guess you like

Origin blog.csdn.net/qq_41037744/article/details/110038687