[笔记]Cucumber在windows下的安装

摘要:
下载后,将其解压缩到D:Opencmd并运行以下命令cdd:rubydk。rbinstall[信息]正在更新'C的约定通知ge更多规则:

1.下载安装Ruby

安装Cucumber要用到gem,gem是Ruby程序管理工具,类似于linux中的apt-get。所以要在Windows中安装好Ruby1.9.2的版本相对稳定些,在这里可以下载Ruby,Windows的安装包一路Next就可以了,安装完成后以cmd输入:ruby -v查看版本,如果提示不是内部命令,着加系统环境变量。

升级gems

gem update --system

2.安装Devkit

Devkit是Ruby在Windows下的开发工具集,在这里可以下载Devkit,下载后解压到D:\Devkit目录下,打开cmd运行以下命令

cd d:\Devkit   
ruby dk.rb init   
ruby dk.rb review 
ruby dk.rb install

运行以上命令可以看到以下相应的提示,说明安装成功了

C:\DevKit>ruby dk.rb init
[INFO] found RubyInstaller v1.9.2 at C:/Ruby192

Initialization complete! Please review and modify the auto-generated
'config.yml' file to ensure it contains the root directories to all
of the installed Rubies you want enhanced by the DevKit.

C:\DevKit>ruby dk.rb review
Based upon the settings in the 'config.yml' file generated
from running 'ruby dk.rb init' and any of your customizations,
DevKit functionality will be injected into the following Rubies
when you run 'ruby dk.rb install'.

C:/Ruby192

C:\DevKit>ruby dk.rb install
[INFO] Updating convenience notice gem override for 'C:/Ruby192'
[INFO] Installing 'C:/Ruby192/lib/ruby/site_ruby/devkit.rb'

3.安装Cucumber

这时可以打开cmd运行命令安装Cucumber以及相关的一些工具

gem install cucumber
gem install selenium-webdriver
gem install capybara
gem install rspec

 

  安装过程可能出现这种错误:ERROR: Failed to build gem native extension

我也找了很久也找不到问题的原因,谷歌搜后找到国外的网站有提到这个错误,讲到有两种情况会产生这个错误,我把其中一种方法贴出来

If the problem persist, invoke the following commands in the same command prompt:(在cmd里运行以下命令,查看结果)

REG QUERY "HKCU\Software\Microsoft\Command Processor"
REG QUERY "HKLM\Software\Microsoft\Command Processor"

Execute each line individually. Once you run it, will see something like this:(当运行上面的命令时,可以看到以下信息)

HKEY_CURRENT_USER\Software\Microsoft\Command Processor    CompletionChar    REG_DWORD    0x9    DefaultColor    REG_DWORD    0x0    EnableExtensions    REG_DWORD    0x1    PathCompletionChar    REG_DWORD    0x9

The columns of information are Key, Type and Value. If you see a key named AutoRun, there is a chance this is the culprit of the error you’re receiving.

AutoRun interferes with Ruby messing with child process executing and by result, affecting gem installation. Please remove it with the following command:(运行以下命令)

REG DELETE "HKCU\Software\Microsoft\Command Processor" /v AutoRun

Once you’re done, try opening a new command prompt and executing gem installation again.(大概意思是去除注册表中的“AutoRun”键)

 

在cmd中运行Cucumber就可以看到各种提示,因为还没有写features文件,在Windows下feature文件用中文的关键字就无法显示颜色,这时可以安装ansi151.zip,在cmd中ansicon.exe -i安装,ansicon.exe -u删除。但是对utf-8的处理有问题,不建议安装。只要用在feature文件中用英文的关键字就可以显示颜色。

免责声明:文章转载自《[笔记]Cucumber在windows下的安装》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇C#字符串(String)类型中@的用法Valgrind使用说明下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Linux设置和查看环境变量的方法

1. 显示环境变量HOME $ echo $HOME /home/redbooks 2. 设置一个新的环境变量hello $ export HELLO="Hello!" $ echo $HELLO Hello! 3. 使用env命令显示所有的环境变量 $ env HOSTNAME=redbooks.safe.org PVM_RS...

富文本编辑器-Ueditor

    富文本编辑器,Rich Text Editor, 简称 RTE, 它提供类似于 Microsoft Word 的编辑功能,容易被不会编写 HTML 的用户并需要设置各种文本格式的用户所喜爱。它的应用也越来越广泛。最先只有 IE 浏览器支持,其它浏览器相继跟进,在功能的丰富性来说,还是 IE 强些。虽然没有一个统一的标准,但对于最基本的功能,各浏览器提...

Asp.net2.0 VS 2005下的repeater控件本功能分页实例(共有 条记录 共有几页 当前第 页 首页,上一页,下一页,尾页 DropDownList跳转)

一、预览效果二、前台控件呈现部分 <asp:repeater id="LeaveMessage" runat="server" ><ItemTemplate><table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor=...

在linux中查询硬件相关信息

1、查询cpu的相关   a、查询CPU的统计信息   使用命令:lscpu   得到的结果如下:    Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s):...

jpgraph 折线图--解决中文乱码的问题(标题和图例)

在jpgraph根目录中: 如Jpgjpgraph_ttf.inc.php 中开头添加 define('CHINESE_TTF_FONT','SIMYOU.TTF'); Jpgjpgraph_legend.inc.php 中大约24行添加 修改 public $font_family=FF_CHINESE,$font_style=FS_NORMAL,$fo...

Android:在任务列表隐藏最近打开的app

对于某一个应用,如果不想在最近打开的app列表中留下任何纪录,即按下Home键回到主页,再按任务键的时候,任务列表看不到这个app,在AndroidManifest中给Activity标签添加:android:excludeFromRecents=”true”即可。 <?xml version="1.0" encoding="utf-8"?>...