首先,需要在电脑里面安装RubyGems
注:1.9.2以上版本的Ruby已经将RubyGems集成,无需单独安装
Step1:安装Ruby
apt (Debian or Ubuntu)
Debian GNU/Linux and Ubuntu use the apt package manager. You can use it like this:
$ sudo apt-get install ruby-full
yum (CentOS, Fedora, or RHEL)
CentOS, Fedora, and RHEL use the yum package manager. You can use it like this:
$ sudo yum install ruby
Step2:安装RubyGems
现在RubyGems包,点击这里,然后cd进解压缩后的文件夹,运行
ruby setup.rb
注意:如果出现错误“RDoc documentation generator not installed: no such file to l”,则需要先安装ruby-rdoc,
yum install ruby-rdoc
然后再重新运行setup命令