【问题标题】:Why can I compile and install Nokogiri, but can't require it, in Windows 7?为什么我可以在 Windows 7 中编译和安装 Nokogiri,但不能要求它?
【发布时间】:2013-06-04 07:18:07
【问题描述】:

我正在尝试在使用 64 位版本的 Windows、Ruby 2.0.0 和 DevKit 的 64 位 PC 上的 Windows 7 上使用 Nokogiri。我刚刚从ftp://ftp.zlatkovic.com/libxml/64bit/ 安装了xml2/xslt/iconv/zlib 库并将include/libxml2/libxml 移动到include/libxml;我想我可以调整 --with-xml2-include),然后安装 Nokogiri。它似乎可以很好地构建本机扩展。

当我尝试要求 Nokogiri 时,我得到:

C:/Users/echristopherson/Development/Ruby/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
`require':LoadError: 126: The specified module could not be found.   -
C:/Users/echristopherson/Development/Ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.so

当我检查文件类型时:

file C:/Users/echristopherson/Development/Ruby/lib/ruby/gems/2.0.0/gems/nokogiri-1.5.9/lib/nokogiri/nokogiri.so 

它输出:

PE32+ executable for MS Windows (DLL) (console) Mono /.Net assembly.

我做错了什么?我使用gem install --pre nokogiri ... 得到相同的结果。

【问题讨论】:

    标签: ruby nokogiri


    【解决方案1】:

    根据您的输出,我看到您使用的是 Ruby 2.0.0。 Nokogiri 尚不支持 Windows x64 上的 Ruby 2.0.0;根据Nokogiri issue 864,这是由于rake-compiler's current inability (as of May 7, 2013) to target the x64-mingw32 platform

    【讨论】:

    • 哦。谢谢你告诉我。
    • 我无法让我的应用通过安装程序中的 Ruby 2.0.0-p247 在 Windows 7 上通过“捆绑安装”。它给我 nokogiri 带来了麻烦,并说它找不到 libxml。这是这里的问题吗?我应该退回到 1.9.x 吗?
    • @B5Fan74 你的 windows 7 是 32 位还是 64 位?
    猜你喜欢
    • 1970-01-01
    • 2018-05-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-03
    相关资源
    最近更新 更多