收到错误“msvcrt-ruby18.dll 丢失”安装 rubyinstaller-1.9.2-p136 后运行 watir 脚本时
安装 rubyinstaller-1.9.2-p136 并在 cmd 提示符下运行以下命令。
宝石更新--系统
宝石安装 watir。
命令已成功执行。但是,当我运行包含以下内容的 ruby 脚本时,出现错误“程序无法启动,因为您的计算机中缺少 msvcrt-ruby18.dll。请尝试重新安装程序来解决此问题。”我尝试过多次重新安装,但没有成功。 我四处搜索并找到了 msvcrt-ruby18.dll 文件。但我不知道我应该用它做什么。请帮忙!
我的 ruby 文件的内容:
需要 'watir'
ie = Watir::IE.new
ie.goto('http://www.google.com')
Installed rubyinstaller-1.9.2-p136 and ran the the following commands in the cmd prompt.
gem update --system
gem install watir.
The commands got executed successfully. But when i ran a ruby script with the following contents in it, i am getting the error "The program can't start because msvcrt-ruby18.dll is missing from your computer. Try reinstalling the program to fix this problem. " I tried reinstalling it multiple times, but no luck.
I google around and found the msvcrt-ruby18.dll file. But i don't know what i should do with it. Please help!
Contents of my ruby file:
require 'watir'
ie = Watir::IE.new
ie.goto('http://www.google.com')
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可能已经安装了一些针对 msvcrt-ruby18.dll 构建的二进制 gem。解决方案是
重新安装它,但强制本地编译,即
gem install gemname --platform=ruby
You've probably installed some binary gems that was built against msvcrt-ruby18.dll. The solution is to
Reinstall it, but force local compilation, i.e.
gem install gemname --platform=ruby
您尝试过使用 Ruby 1.8.6 吗?我在 Watir Google 网上论坛中看到了推荐内容。
另外,我在 ruby 论坛帖子,尤其是底部。如果您刚刚开始,那么可能不需要支持最新版本的 Ruby,因为使用以前版本的 Ruby 编译的库存在一些问题。
显然,Watir 是用 1.8.x 构建的。另一种选择是使用 Vapir,它基于 Watir,但由于该分支的更改而无法向后完全兼容。
Did you try going to Ruby 1.8.6? I saw that recommended in the Google Groups for Watir.
Also, I saw a reference to that in an issues about this in a ruby forum thread, especially towards the bottom. If you are just getting started, then there probably isn't a need to support the newest version of Ruby, which has some issues with libraries compiled with previous versions of Ruby.
Apparently, Watir was built with 1.8.x. An alternative is to use Vapir, which is based on Watir but not backwards completely compatible because of changes in that branch.
如果您想运行 wxRuby,请不要下载 ruby18 版本。你得到的是这样的:
[注意]
您可能在 Ruby 解释器或扩展库中遇到了错误。
欢迎报告错误。
详细信息:http://www.ruby-lang.org/bugreport.html
这个应用程序请求运行时以异常方式终止它。
请联系应用程序的支持团队以获取更多信息。
gem(wxruby 19)下载并安装得很好。当然,这并不意味着它一定会运行。
Don't download the ruby18 version if you like to run wxRuby. What you get is this:
[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: http://www.ruby-lang.org/bugreport.html
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
the gem (wxruby 19) downloaded and installed just fine. Of course, that doesn't mean it will necessarily run.
要修复此错误,我们需要注册 autoit dll“AutoItX3.dll”。在我的机器中,dll 位于 C:\Ruby192\lib\ruby\gems\1.9.1\gems\rautomation-0.6.3\ext\AutoItX。因此,您需要在命令提示符下转到此文件夹并执行“regsvr AutoItX3.dll”。这解决了问题
To fix this error, we need to register the autoit dll "AutoItX3.dll". In my machine the dll is located at C:\Ruby192\lib\ruby\gems\1.9.1\gems\rautomation-0.6.3\ext\AutoItX. So, you need to goto this folder in command prompt and execute "regsvr AutoItX3.dll". That fixed the problem