Ruby无法加载此类文件--ftools(加载错误)

时间:2012-07-19 00:54:05

标签: ruby

我是一个完整的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。

2 个答案:

答案 0 :(得分:12)

使用

  

需要“fileutils”

因为ruby-1.9.x

不支持ftools

答案 1 :(得分:1)

显然,我的源代码已经老了很多,甚至在获得最新版本之后,它也有问题。但是知道它在某些时候起作用了,我继续在Windows上安装旧版本的Ruby(1.8.7-p358),一切正常,然后我能够构建并获取我的可执行文件。无论如何,不​​是最优雅的解决方案。但是,如果有人知道使用最新的Windows版本的Ruby修复rubyscript2exe,请回复。感谢。