第一步——用RVM安装Ruby
sudo apt-get update

如果在你的系统上没有 curl ,你需要安装它:
sudo apt-get install curl

要安装RVM,在终端中输入下面的命令:
curl -L https://get.rvm.io | bash -s stable


安装完毕后,载入RVM。你需要先退出shell然后重新开启一个新的shell会话。
source ~/.rvm/scripts/rvm
为了能正常工作,RMV必须安装一些依赖。你可以让RVM自动安装它们:
rvm requirements

你可能需要输入root密码来允许安装这些依赖。
某些情况下,系统可能会提示找不到zlib包。RVM 页面详细描述了这个问题以及解决方法。
第二步——安装 Ruby
rvm install ruby

最新版本的的Ruby,在此处同时安装了rubygems,我们需要告诉系统应该使用刚才安装的 Ruby 作为默认版本。
rvm use ruby --default
可以使用 RVM 安装 gems。在终端中输入下面的命令:
rvm rubygems current
第三步——安装 Rails
安装 Rails 的时候。打开终端输入下面的命令:
gem install rails

这次安装需要一些时间和耐心。它将安装 Ruby on Rails 到你的服务器上。
这是第一次顺利安装好环境,在windows上总是出现各种错,果断放弃,还是在ubuntu上安装简单,在安装过程中资源网站要使用淘宝镜像,不然会连接报错。此外在安装过程中还出现了如下错误
b:73: warning: Insecure world writable dir /home/kwh in PATH, mode 040777
网友评论