windows 平台安装 cucumber

2016-11-04 09:50:39来源:oschina作者:jeffsui人点击

第七城市


# 1. install [rubyinstaller](http://dl.bintray.com/oneclick/rubyinstaller/rubyinstaller-2.2.5-x64.exe)
```
ruby -v
```
测试是否安装成功
# 2. config proxy
```
vi ~/.gemrc
```
```
gem: --http-proxy http://[ip]:[port]
```
# 3. validation ssl version
```
$ ruby -ropenssl -e 'p OpenSSL::OPENSSL_VERSION'
"OpenSSL 1.0.1l 15 Jan 2015"
```
# 4. gem install cucumber,rspec,selenium etc...
```
gem install cucumber -v 1.3.13
gem install rspec
gem install selenium-webdriver
gem install watir-webdriver
gem install watir
```
## 4.1 遇到的坑
```
C:/>gem install cucumber
Fetching: builder-3.2.2.gem (100%)
Successfully installed builder-3.2.2
Fetching: diff-lcs-1.2.4.gem (100%)
Successfully installed diff-lcs-1.2.4
Fetching: multi_json-1.7.6.gem (100%)
Successfully installed multi_json-1.7.6
Fetching: gherkin-2.12.0.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 '/2014th7cj/d/file/p/20161103/llnopuj2flp' and follow the instructions
at '/2014th7cj/d/file/p/20161103/l5jplgjvvia 4.2Download [DevKit](http://dl.bintray.com/oneclick/rubyinstaller/DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe)
uncompress `DevKit`to `c:Ruby/DevKit`
```
ruby dk.rb init
ruby install dk.rb
```
## 4.3 `gem install cucumber -v 1.3.13 `
if still got error msg similar like :
```
Could not find a valid gem 'rails' (>= 0), here is why: Unable to download data from /2014th7cj/d/file/p/20161103/gcmwdvuyiti - SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed (/2014th7cj/d/file/p/20161103/gcmwdvuyitispecs.4.8.gz)
```
To solve this issue you should download ca from [gemsearch](/2014th7cj/d/file/p/20161103/gcmwdvuyiti),copy it into `C:/Ruby22-x64/lib/ruby/2.2.0/rubygems/ssl_certs/`
## 5. 参考文档
*[error installing cucumber in windows 8](/2014th7cj/d/file/p/20161103/qlnkz2uzkcx validation error](https://teamtreehouse.com/community/rails-read-server-certificate-b-certificate-verify-failed)
第七城市

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台