Ruby无法加载这样的文件–ftools(加载错误)

前端之家收集整理的这篇文章主要介绍了Ruby无法加载这样的文件–ftools(加载错误)前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我是一个完整的 Ruby新手,我想做的只是运行一个传统的ruby脚本(这也是Erik Veenstra的开源脚本).我有一个Windows批处理脚本,基本上我正在尝试执行它.我在我的计算机上安装了Ruby,允许它设置路径,我试图运行它,这是我得到的错误
I:/2011/devl/3rdparty/ruby/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- ftools (LoadError)
        from I:/2011/devl/3rdparty/ruby/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Users/<blah>/AppData/Local/Temp/tar2rubyscript.d.6692.1/rubyscript2exe/ev/ftools.rb:1:in `<top (required)>'
        from I:/2011/devl/3rdparty/ruby/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from I:/2011/devl/3rdparty/ruby/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
        from C:/Users/<blah>/AppData/Local/Temp/tar2rubyscript.d.6692.1/rubyscript2exe/init.rb:15:in `<top (required)>'
        from I:/2011/devl/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:627:in `load'
        from I:/2011/devl/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:627:in `block in <main>'
        from I:/2011/devl/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:577:in `block in newlocation'
        from I:/2011/devl/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:505:in `block in newlocation'
        from I:/2011/devl/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:472:in `newlocation'
        from I:/2011/devl/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:505:in `newlocation'
        from I:/2011/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:577:in `newlocation'
        from I:/2011/devl/path/to/<myrbsrc>/trunk/bin/../src/rubyscript2exe.rb:619:in `<main>'

欣赏有关如何解决此问题的任何想法!如果有帮助我可以发布源代码Ruby代码.

解决方法

使用

require “fileutils”

相反,因为ruby-1.9.x不支持ftools

原文链接:https://www.f2er.com/ruby/269310.html

猜你在找的Ruby相关文章