简体   繁体   English

无法安装watir gem

[英]Not able to install watir gem

I installed ruby186-27_rc2 and i am getting the same error as described in the Ruby: Cannot Install Watir Gem On Windows thread when i try to install watir using gem install watir . 我安装了ruby186-27_rc2,并且遇到与Ruby中所述相同的错误当我尝试使用gem install watir安装watir时, 无法在Windows线程上安装Watir Gem Please see the error below. 请查看以下错误。

C:\DevKit>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.....

And then tried to install the devkit as suggested in the thread mentioned above. 然后尝试按照上述线程中的建议安装devkit。 During the devkit installation i came up with a problem. 在devkit安装期间,我遇到了一个问题。

In step4 of devkit installation as described at Development Kit wiki i have added the path C:\\Ruby to the config file and then ran the command ruby dk.rb install and i got the following error. 开发套件Wiki中描述的devkit安装的步骤4中,我已将路径C:\\Ruby到配置文件,然后运行命令ruby dk.rb install ,出现以下错误。 Please help! 请帮忙! Waiting for your inputs. 等待您的输入。 Thanks! 谢谢!

C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load': syntax error on line 15, col -1: `'
(ArgumentError)
        from C:/Ruby/lib/ruby/1.8/yaml.rb:133:in `load'
        from dk.rb:151:in `review'
        from dk.rb:143:in `open'
        from dk.rb:143:in `review'
        from dk.rb:248:in `send'
        from dk.rb:248:in `run'
        from dk.rb:262

The DevKit contains a development environment for the MinGW port of MRI and YARV . DevKit包含用于MRI和YARVMinGW端口的开发环境。 You are using the MSVC6 port of MRI, so you need to install a development environment for MSVC6. 您正在使用MRI的MSVC6端口,因此需要为MSVC6安装开发环境。

Unfortunately, there is no ready-made DevKit-like package for that. 不幸的是,还没有现成的类似DevKit的软件包。 You will have to install it on your own. 您将必须自行安装。 Note that it's not actually that hard to install, the biggest problem is to get a hold of a copy of Microsoft Visual C 6.0, since that hasn't been on sale for about 10 years now. 请注意,它实际上并没有那么难安装,最大的问题是得到微软的Visual C ++ 6.0的副本的保持,因为还没有开始发售了大约10年了。 You'll basically have to find someone who is going to sell you a used copy. 您基本上必须找到要向您出售旧副本的人。

May I ask why you need to use a port of Ruby that hasn't been maintained in over 2 years, contains a version of Ruby that is so old that it cannot even run most modern code (eg Rails requires at least 1.8.7 or 1.9.2) and has several bugs, including security holes? 请问为什么您需要使用超过两年未维护的Ruby端口,其中包含的Ruby版本太旧了,甚至无法运行大多数现代代码(例如,Rails至少需要1.8.7或1.9.2)并且有几个错误,包括安全漏洞? Why don't you just use the MinGW port which is actually maintained? 您为什么不只使用实际维护的MinGW端口?

This is all independent of the actual problem, of course, which is that you have a syntax error in your config.yml : you missed a dash and a space on line 15, which should read 当然,这完全独立于实际问题,即config.yml存在语法错误:您错过了第15行的破折号和空格,该行应显示为

- C:/Ruby

as indicated in the example section directly above it. 如其正上方的example部分所示。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM