Ruby:无法在 Windows 上安装 Watir Gem
Watir 网站 说我需要 Ruby 1.8.6,我正在运行它。 Windows 安装应该像 gem install watir
一样简单。但是当我运行它时,我得到:
C:\Users\Ryguy\Code>gem install watir
Building native extensions. This could take a while...
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
checking for strncpy_s()... no
creating Makefile
make
'make' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5 f
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5/ext/gem_make.out
我的 Ruby 版本: ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]
我的 RubyGems 版本: 1.3.5
Watir's site says I need Ruby 1.8.6, which I'm running. And windows installation should be as simple as gem install watir
. But when I run that, I get this:
C:\Users\Ryguy\Code>gem install watir
Building native extensions. This could take a while...
ERROR: Error installing watir:
ERROR: Failed to build gem native extension.
C:/Ruby/bin/ruby.exe extconf.rb
checking for strncpy_s()... no
creating Makefile
make
'make' is not recognized as an internal or external command,
operable program or batch file.
Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5 f
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/win32-api-1.4.5/ext/gem_make.out
My Ruby Version: ruby 1.8.6 (2009-08-04 patchlevel 383) [i386-mingw32]
My RubyGems Version: 1.3.5
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我建议您安装此处记录的 RubyInstaller 开发工具
包安装它后,Watir 依赖项(win32-api)的编译过程将安装成功。
I would recommend you install the RubyInstaller Development Kit as documented here
Once you've installed it, the compile process of Watir dependencies (win32-api) will install successfully.
结果我需要安装 Ruby 开发文件。 =/
Turns out I needed to install the Ruby Development files. =/
执行下面的命令及其工作
gem install watir --platform=mswin32
Execute Below command and its works
gem install watir --platform=mswin32
安装了 devkit 并在 Windows 7 上从 cmd 调用 bat 文件后修复了此问题。使用 Ruby 1.9.1
Installed devkit and after calling the bat file on Windows 7 from a cmd it fixed this issue. Using Ruby 1.9.1
在安装 DevKit 后,我还必须安装 nokogiri 才能在 Windows 上成功安装 Watir。使用:gem install nokogiri
I also had to install nokogiri to get Watir to install successfully on windows, after installing DevKit. Use: gem install nokogiri