没有要加载的文件 -- ffi_c (LoadError) [英] no such file to load -- ffi_c (LoadError)

查看:52
本文介绍了没有要加载的文件 -- ffi_c (LoadError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个问题困扰了我几天......每当我使用 .bring_to_front 方法时

This problem is bugging me for a couple of days now... Whenever I'm using the .bring_to_front method

require "rubygems"
require "watir"

browser = Watir::Browser::new
browser.bring_to_front

我收到此错误:

(...)rubygems/custom_require.rb:36:in `require': no such file to load -- ffi_c (LoadError)

我尝试卸载并重新安装 ffi/watir/ruby/netbeans,但没有成功.

I tried uninstalling and reinstalling ffi/watir/ruby/netbeans without success.

第 36 行在 custom_require.rb 中

line 36 is in custom_require.rb

def require path
if Gem.unresolved_deps.empty? or Gem.loaded_path? path then
  gem_original_require path
else
  spec = Gem.searcher.find_active path
  unless spec then
    found_specs = Gem.searcher.find_in_unresolved path
    unless found_specs.empty? then
      found_specs = [found_specs.last]
    else
      found_specs = Gem.searcher.find_in_unresolved_tree path
    end
    found_specs.each do |found_spec|
      Gem.activate_spec found_spec
    end
  end
  return gem_original_require path #problem
end

* 本地宝石 *

archive-tar-minitar (0.5.2)
builder (3.0.0)
childprocess (0.2.2)
columnize (0.3.4)
commonwatir (2.0.4)
ffi (1.0.10 x86-mingw32)
firewatir (1.9.4, 1.8.1)
hoe (2.12.3, 2.8.0)
json (1.6.1)
json_pure (1.6.1)
linecache19 (0.5.12)
minitest (2.7.0, 2.6.2, 1.6.0)
nokogiri (1.5.0 x86-mingw32)
rake (0.9.2.2, 0.9.2, 0.8.7)
rautomation (0.6.3)
rdiscount (1.6.8)
rdoc (3.11, 2.5.8)
require_all (1.2.0)
ruby-debug-base19 (0.11.25)
ruby-debug-ide (0.4.16, 0.4.9)
ruby_core_source (0.1.5)
rubyzip (0.9.4)
s4t-utils (1.0.4)
selenium-webdriver (2.10.0)
user-choices (1.1.6.1)
watir (2.0.4)
watir-webdriver (0.3.5)
win32-api (1.4.8 x86-mingw32)
win32-process (0.6.5)
windows-api (0.4.0)
windows-pr (1.2.1)
xml-simple (1.1.1, 1.1.0)

推荐答案

我认为丢失的文件与 FFI gem 相关.我自己尝试使用 FFI v1.0.10 时遇到问题(安装时,由于与 webdriver 代码有关的问题)所以在我的盒子上我安装了该 gem 的 v1.0.9.

I think the missing file relates to the FFI gem. I had issues trying to use FFI v1.0.10 myself (when it went to install, and due to something pertaining to webdriver code) so on my box I have v1.0.9 of that gem installed.

我想说,尝试将该 gem 回滚到一个版本不会有太多损失.从命令行输入

I'd say there's not much to lose by trying to roll that gem back a version. From the command line type

gem uninstall ffi

完成后

gem install ffi -v 1.0.9

看看是否可以为您解决问题.

See if that fixes things for you.

更新 FFI gem 已经更新到 1.1.0 之后,这些版本似乎在 watir 和 watir-webdriver 上运行良好,但是 gem 没有预编译,并且必须在它安装.这意味着如果您在 PC 上运行,则需要为 Windows 安装 Ruby 开发工具包,也就是 'devkit',您可以从 ruby​​installer 站点上的下载页面获得它

Update the FFI gem has since updated past 1.1.0 and these versions seem to work fine with watir and watir-webdriver, however the gem is not pre-compiled, and has to compile code when it installs. This means if you are running on a PC you will need to install the Ruby development kit for windows, aka 'devkit', you can get it from the downloads page on the rubyinstaller site

先下载并安装devkit,然后打开一个新的命令行窗口并使用

download and install devkit first, then open a new command line window and use

gem install ffi

获取最新版本的 FFI gem

to get the latest version of the FFI gem

如果由于某种原因对您不起作用,您可以随时使用上面的原始说明安装稍旧版本的 FFI gem

if for some reason that does not work for you, you can always use the original instructions above to install the slightly older version of the FFI gem

这篇关于没有要加载的文件 -- ffi_c (LoadError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆