瓦提尔与 IronRuby!
有人成功地将 Watir 与 IronRuby 结合使用吗?我收到一条错误消息,指出未找到所需的文件“Watir”。我需要设置什么路径才能使该文件在 IronRuby 中工作?
由于某种原因,我的 igem 命令无法正常工作:
C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>igem install 瓦蒂尔 '“C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin\ir.exe”' 不被识别为内部或外部命令, 可运行的程序或批处理文件。
我正在使用 Ironruby 0.9 版本。
我记得在0.9中你必须指出ir工具:我使用了以下内容,再次出现错误!
C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>ir igem ins 高瓦提尔 错误:执行 gem 时...(RangeError) bignum 太大,无法转换为 Fixnum
RubyGems 的当前版本是 1.3.5:
C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>ir igem -v 1.3.5
我什至尝试使用完整路径:
require File.dirname(__FILE__) + "C:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir.rb"
Has anyone used Watir with IronRuby successfully? I am getting an error that the required file 'Watir' was not found. What path do I need to set to get this file to work in IronRuby?
For some reason my igem command is not working:
C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>igem instal
l watir
'"C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin\ir.exe"'
is not recognized as an internal or external command,
operable program or batch file.
I am using 0.9 version of Ironruby.
I remember that in 0.9 you have to indicate the ir tool: I used the following and got the error again!
C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>ir igem ins
tall watir
ERROR: While executing gem ... (RangeError)
bignum too big to convert into Fixnum
The current version of RubyGems is 1.3.5:
C:\DevTools\IronRuby\ironruby\Merlin\Main\Languages\Ruby\Scripts\bin>ir igem -v
1.3.5
I even tried using the full path:
require File.dirname(__FILE__) + "C:/ruby/lib/ruby/gems/1.8/gems/commonwatir-1.6.2/lib/watir.rb"
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您使用的是
gem install watir
还是igem install watir
?如果您要为 IronRuby 安装 gem,则必须使用igem
。否则,它最终会被放入 Ruby 安装所在的 gems 目录中。默认情况下,IronRuby 不会看到该 gems 目录,您必须使用完整路径才能访问它。使用igem
时,它将 gem 放入正确的目录中以便与 IronRuby 一起使用。Did you use
gem install watir
origem install watir
? If you are installing gems for IronRuby you have to useigem
. Otherwise, it ends up being put inside the gems directory where your Ruby installation resides. IronRuby will not see that gems directory by default and you would have to use the full path to get to it. When usingigem
it puts the gem in the correct directory for use with IronRuby.Watir 使用 MRI Ruby 的 WIN32OLE 库。 Iron Ruby 支持该库吗?
Watir uses MRI Ruby's WIN32OLE library. Is this library supported with Iron Ruby?
我发现,当您在常规 ruby 中收到所需的 watir not found 消息时,您需要在 require 'watir' 之前放置文本 require 'rubygems'
I found that when you get the required watir not found message in regular ruby you need to put before require 'watir' the text require 'rubygems'