我刚刚在我的windows 7电脑上安装了Ruby 1.9.3。现在我正在寻找一些自动化脚本编写。但为此,我必须安装以下,但我如何安装它们?
- 硒
- NokoGiri
- 水豚
我的Ruby版本安装在- C:Ruby193
目录下。要从命令提示符运行Ruby命令,我是否需要向PATH
变量添加任何内容?
Microsoft Windows [Version 6.1.7600]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:Userspeter>cd..
C:Users>cd..
C:>cd C:Ruby193
C:Ruby193>ruby
'ruby' is not recognized as an internal or external command,
operable program or batch file.
C:Ruby193>gem install nokogiri
'gem' is not recognized as an internal or external command,
operable program or batch file.
C:Ruby193>
gem install nokogiri
首先需要更新环境变量PATH,指向ruby的bin文件夹。然后你必须安装DevKit,因为你是在windows上。从这里你可以下载DevKit: http://rubyinstaller.org/downloads/.
所有这些都安装成功后,只有你可以安装任何gem。