无法加载这样的文件 - libxml_ruby for Windows [英] cannot load such file -- libxml_ruby for Windows

查看:289
本文介绍了无法加载这样的文件 - libxml_ruby for Windows的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的步骤是,


  1. 执行RubyInstaller.exe文件

  2. 安装ruby
  3. >
  4. 路径:c:\ ruby​​193

  5. 安装DevKit

  6. gem install libxml-ruby --platform x86- mswin32-60

  7. make test.rb文件

    require'rubygems'

    require' xml'


  8. ruby​​ test.rb


  9. 打印错误信息

错误消息:

  C:/ Ruby193 / lib / ruby /site_ruby/1.9.1/rubygems/custom_require.rb:36:in`require':
126:无法找到指定的模块 - C:/Ruby193/lib/ruby/gems/1.9.1/gems / lib
xml-ruby-1.1.3-x86-mswin32-60 / lib / libxml_ruby.so(LoadError)从C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/下载
custom_require.rb:36:在'require'中
从C:/Ruby193/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.3-x86-mswin32-6 0 / lib / libxml .rb:9:从<< top(required)>'
from C:/ Ruby193 / lib / ruby / site_ruby / 1.9.1 / ruby​​gems / custom_require.rb:36:在'require'
从C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:在`需要C:/Ruby193/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.3-x86-mswin32-6 0 / lib / xml.rb:11中的
:在<< ;从C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:在'require'
从C:/ Ruby193 / lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / custom_require.rb:60:在`rescue in require'
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb: 35:'require'
from test.rb:2:'< main>'

我想解决这个问题
plz。帮助我。

解决方案

在Windows 7x64上使用libxml-ruby 2.3.3(Ruby 2,1.9.3和1.9 0.2)。按照此解决方案:

https: //github.com/xml4r/libxml-ruby/issues/42#issuecomment-7040881



我管理我的问题也解决了。解决方案(感谢原作者):


  1. 在libxml-ruby gem文件夹中找到'libxml.rb'(类似于'C:\\ \\ Ruby \Ruby192 \lib\ruby\gems\1.9.1\gems\libxml-ruby-2.3.3-x86-mingw32\lib')



  2. ENV ['PATH'] = ENV ['PATH'] +';'+ File.expand_path(

  3. 保存并享受

  4. b $ b

    My step is,

    1. Execute RubyInstaller.exe file
    2. install ruby
    3. installed Path: c:\ruby193
    4. install DevKit
    5. gem install libxml-ruby --platform x86-mswin32-60
    6. make test.rb file

      require 'rubygems'
      require 'xml'

    7. ruby test.rb

    8. print error msg

    Error message:

    C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require':
    126: The specified module could not be found    - C:/Ruby193/lib/ruby/gems/1.9.1/gems/lib
    xml-ruby-1.1.3-x86-mswin32-60/lib/libxml_ruby.so (LoadError)
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
            from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.3-x86-mswin32-6    0/lib/libxml.rb:9:in `<top (required)>'
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
            from C:/Ruby193/lib/ruby/gems/1.9.1/gems/libxml-ruby-1.1.3-x86-mswin32-6    0/lib/xml.rb:11:in `<top (required)>'
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `require'
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:60:in `rescue in require'
            from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
            from test.rb:2:in `<main>'
    

    i want solution in this problem plz. help me.

    解决方案

    Had similar problem on Windows 7x64 with libxml-ruby 2.3.3 (Ruby 2, 1.9.3 and 1.9.2). As per this solution:

    https://github.com/xml4r/libxml-ruby/issues/42#issuecomment-7040881

    I managed my problem was also solved. Solution (thanks to the original author):

    1. Locate 'libxml.rb' in libxml-ruby gem folder (something like 'C:\Ruby\Ruby192\lib\ruby\gems\1.9.1\gems\libxml-ruby-2.3.3-x86-mingw32\lib')
    2. Add the following on top of the file:

      ENV['PATH'] = ENV['PATH'] + ';' + File.expand_path(File.dirname(__FILE__) + '/libs')

    3. Save and enjoy

    这篇关于无法加载这样的文件 - libxml_ruby for Windows的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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