无法加载这样的文件 - libxml_ruby为Windows
我的步骤是,无法加载这样的文件 - libxml_ruby为Windows
- 执行RubyInstaller.exe文件
- 安装Ruby
- 安装路径:C:\ ruby193
- 安装的devkit
- gem install libxml-ruby --platform x86-mswin32-60
-
make test.rb文件
需要 '的rubygems'
需要 'XML' 红宝石test.rb
- 打印错误味精
错误消息:
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>'
我想在该溶液中问题 plz。帮我。
在Windows 7x64上,libxml-ruby 2.3.3(Ruby 2,1.9.3和1.9.2)出现类似问题。按照此解决方案:
https://github.com/xml4r/libxml-ruby/issues/42#issuecomment-7040881
我管理我的问题也解决了。解决方案(感谢原作者):
- 在libxml的,红宝石的宝石文件夹找到 'libxml.rb'(类似“C:\红宝石\ Ruby192 \ LIB \红宝石\宝石\ 1.9.1 \宝石\的libxml-红宝石2.3.3 86的mingw32 \ lib中 ')
-
添加上文件的顶部以下内容:
ENV [' PATH '] = ENV [' PATH'] + ';' + File.expand_path(File.dirname(__ FILE__)+ '/库')
保存和欣赏
什么是“__FILE__”?这对我来说不起作用,尽管...我仍然继续得到相同的异常 – user3115056
@ user3115056你有什么发现吗? –
那么,由于某种原因,红宝石寻找UNIX和Linux共享库,而不是Windows的DLL。我不能说为什么。 – Linuxios