收到错误“msvcrt-ruby18.dll 丢失”安装 ruby​​installer-1.9.2-p136 后运行 watir 脚本时

发布于 2024-10-10 01:56:30 字数 381 浏览 0 评论 0原文

安装 ruby​​installer-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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

甩你一脸翔 2024-10-17 01:56:30

您可能已经安装了一些针对 msvcrt-ruby18.dll 构建的二进制 gem。解决方案是

  1. 安装DevKit,这样你就有了一个在本地构建原生代码的环境。
  2. 卸载坏的 gem(这会在需要时导致此对话框)
  3. 重新安装它,但强制本地编译,即

    gem install gemname --platform=ruby

You've probably installed some binary gems that was built against msvcrt-ruby18.dll. The solution is to

  1. install DevKit so that you have an environment for building native code locally.
  2. Uninstall the bad gem (which is causing this dialog when require'd)
  3. Reinstall it, but force local compilation, i.e.

    gem install gemname --platform=ruby

錯遇了你 2024-10-17 01:56:30

您尝试过使用 Ruby 1.8.6 吗?我在 Watir Google 网上论坛中看到了推荐内容。

另外,我在 ruby 论坛帖子,尤其是底部。如果您刚刚开始,那么可能不需要支持最新版本的 Ruby,因为使用以前版本的 Ruby 编译的库存在一些问题。

您可以定义一个 gem 以针对一个 Ruby 版本(使用 gem
规范 required_ruby_version 属性),但是,您无法生成
面向 Ruby 1.8.x 和 1.9.x 系列的二进制 gem。

1.8.x 和 1.9.x 之间存在二进制差异(不同的 C-API,
不同的虚拟机等)制作了这些预编译的扩展
不兼容。**

显然,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.

You can define a gem to be targeted at one version of Ruby (using gem
spec required_ruby_version attribute), however, you can't generate a
binary gem that target both 1.8.x and 1.9.x series of Ruby.

There are binary differences between 1.8.x and 1.9.x (different C-API,
different VM, etc) that made these pre-compiled extensions
incompatible.**

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.

生死何惧 2024-10-17 01:56:30

如果您想运行 wxRuby,请不要下载 ruby​​18 版本。你得到的是这样的:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wxruby2.so: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]

-- control frame ----------
c:0011 p:-10361992 s:0034 b:0034 l:000033 d:000033 TOP   
c:0010 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC  :require
c:0009 p:0013 s:0028 b:0028 l:000027 d:000027 METHOD <internal:lib/rubygems/custom_require>:29
c:0008 p:0011 s:0023 b:0023 l:000022 d:000022 TOP    C:/Ruby192/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12
c:0007 p:---- s:0020 b:0020 l:000019 d:000019 FINISH
c:0006 p:---- s:0018 b:0018 l:000017 d:000017 CFUNC  :require
c:0005 p:0073 s:0014 b:0014 l:000010 d:000013 BLOCK  <internal:lib/rubygems/custom_require>:33
c:0004 p:0014 s:0011 b:0011 l:000010 d:000010 METHOD <internal:lib/rubygems/custom_require>:29
c:0003 p:0011 s:0006 b:0006 l:00175c d:002234 EVAL   MinimalRuby.rb:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00175c d:00175c TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
MinimalRuby.rb:1:in `<main>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:33:in `rescue in require'
<internal:lib/rubygems/custom_require>:33:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'

[注意]
您可能在 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:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wxruby2.so: [BUG] Segmentation fault
ruby 1.9.2p180 (2011-02-18) [i386-mingw32]

-- control frame ----------
c:0011 p:-10361992 s:0034 b:0034 l:000033 d:000033 TOP   
c:0010 p:---- s:0032 b:0032 l:000031 d:000031 CFUNC  :require
c:0009 p:0013 s:0028 b:0028 l:000027 d:000027 METHOD <internal:lib/rubygems/custom_require>:29
c:0008 p:0011 s:0023 b:0023 l:000022 d:000022 TOP    C:/Ruby192/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12
c:0007 p:---- s:0020 b:0020 l:000019 d:000019 FINISH
c:0006 p:---- s:0018 b:0018 l:000017 d:000017 CFUNC  :require
c:0005 p:0073 s:0014 b:0014 l:000010 d:000013 BLOCK  <internal:lib/rubygems/custom_require>:33
c:0004 p:0014 s:0011 b:0011 l:000010 d:000010 METHOD <internal:lib/rubygems/custom_require>:29
c:0003 p:0011 s:0006 b:0006 l:00175c d:002234 EVAL   MinimalRuby.rb:1
c:0002 p:---- s:0004 b:0004 l:000003 d:000003 FINISH
c:0001 p:0000 s:0002 b:0002 l:00175c d:00175c TOP   
---------------------------
-- Ruby level backtrace information ----------------------------------------
MinimalRuby.rb:1:in `<main>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:33:in `rescue in require'
<internal:lib/rubygems/custom_require>:33:in `require'
C:/Ruby192/lib/ruby/gems/1.9.1/gems/wxruby-2.0.1-x86-mingw32/lib/wx.rb:12:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'

[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.

过潦 2024-10-17 01:56:30

要修复此错误,我们需要注册 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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文