下载了ruby-2.0.0-p598-x64-mingw32压缩包,本地解压配了环境变量后,安装cucumber发生了错误:
Fetching: gherkin-2.12.2.gem (100%)
ERROR: Error installing cucumber:
The 'gherkin' native gem requires installed build tools.
Please update your PATH to include build tools or download the DevKit
from 'http://rubyinstaller.org/downloads' and follow the instructions
at 'http://github.com/oneclick/rubyinstaller/wiki/Development-Kit'
于是按照提示去development-kit网站去下载,对应的ruby2.0.0版本的devkit是 DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe这个包。解压后按照命令依次执行:
ruby dk.rb init
ruby dk.rb install
ruby dk.rb review
却又遇到这个错误提示:
Invalid configuration or no Rubies listed. Please fix 'config.yml'
and rerun 'ruby dk.rb install'
我手动去devkit目录下找到config.yml文件,在里面增加了" - D:/ruby2.0.0"解决了该问题,不过按照官网的说法,应该还有这样的解决方式, 点击这里查看。
判断是否安装成功可以试试这个命令:gem install json --platform=ruby
这个时候再回过头去安装cucumber,安装成功。
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
Successfully installed gherkin-2.12.2
Fetching: multi_test-0.1.1.gem (100%)
Successfully installed multi_test-0.1.1
Fetching: cucumber-1.3.18.gem (100%)
Successfully installed cucumber-1.3.18
Parsing documentation for gherkin-2.12.2
Installing ri documentation for gherkin-2.12.2
Parsing documentation for multi_test-0.1.1
Installing ri documentation for multi_test-0.1.1
Parsing documentation for cucumber-1.3.18
Installing ri documentation for cucumber-1.3.18
3 gems installed
每个人的环境都可能存在不同的问题,记录在这里给大家作为参考。