| | 6 | ---- |
| | 7 | == 安装:== |
| | 8 | - [http://files.rubyforge.vm.bytemark.co.uk/rubyinstaller/rubyinstaller-1.9.2-p290.exe window-下载ruby][[BR]] |
| | 9 | |
| | 10 | - [http://rubyforge.org/frs/download.php/66888/devkit-3.4.5r3-20091110.7z window-DevKit] [https://github.com/oneclick/rubyinstaller/downloads 更多DevKit] |
| | 11 | |
| | 12 | - 下载ruby 安装 , 修改系统path配置 , 命令行输入ruby -v |
| | 13 | - 下载DevKit 安装 (安装时,路径不要有空格) |
| | 14 | - 到DevKit安装目录,命令行 |
| | 15 | {{{ |
| | 16 | > cd <DEVKIT_INSTALL_DIR> |
| | 17 | > ruby dk.rb init |
| | 18 | #生成config.yml,这里会检查将要添加DevKit支持的Ruby列表,只支持通过RubyInstaller安装的Ruby |
| | 19 | #如果这里列出的Ruby与你的要求不符,可以手动修改 |
| | 20 | > ruby dk.rb review #检查要添加DevKit支持的Ruby列表是否有误,可以略过 |
| | 21 | > ruby dk.rb install |
| | 22 | [INFO] Updating convenience notice gem override for 'C:/Ruby192' |
| | 23 | [INFO] Installing 'C:/Ruby192/lib/ruby/site_ruby/devkit.rb' |
| | 24 | > |
| | 25 | }}} |
| | 26 | |
| | 27 | - 检查是否安装成功 |
| | 28 | {{{ |
| | 29 | > gem install selenium-webdriver |
| | 30 | }}} |
| | 31 | |
| | 32 | - selenium-webdriver 就是测试工具,安装成功即可 |
| | 33 | {{{ |
| | 34 | C:\Documents and Settings\pc>gem install selenium-webdriver |
| | 35 | Temporarily enhancing PATH to include DevKit... |
| | 36 | Building native extensions. This could take a while... |
| | 37 | Fetching: childprocess-0.3.2.gem (100%) |
| | 38 | Fetching: addressable-2.2.8.gem (100%) |
| | 39 | Fetching: libwebsocket-0.1.3.gem (100%) |
| | 40 | Fetching: selenium-webdriver-2.21.2.gem (100%) |
| | 41 | Successfully installed ffi-1.0.11 |
| | 42 | Successfully installed childprocess-0.3.2 |
| | 43 | Successfully installed addressable-2.2.8 |
| | 44 | Successfully installed libwebsocket-0.1.3 |
| | 45 | Successfully installed selenium-webdriver-2.21.2 |
| | 46 | 5 gems installed |
| | 47 | Installing ri documentation for ffi-1.0.11... |
| | 48 | Installing ri documentation for childprocess-0.3.2... |
| | 49 | Installing ri documentation for addressable-2.2.8... |
| | 50 | Installing ri documentation for libwebsocket-0.1.3... |
| | 51 | Installing ri documentation for selenium-webdriver-2.21.2... |
| | 52 | Installing RDoc documentation for ffi-1.0.11... |
| | 53 | Installing RDoc documentation for childprocess-0.3.2... |
| | 54 | Installing RDoc documentation for addressable-2.2.8... |
| | 55 | Installing RDoc documentation for libwebsocket-0.1.3... |
| | 56 | Installing RDoc documentation for selenium-webdriver-2.21.2... |
| | 57 | }}} |
| | 58 | |
| | 59 | - 编写第一个案例,打开netbeans ,新建ruby工程 |
| | 60 | {{{ |
| | 61 | |
| | 62 | }}} |