我是一个完整的
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>'
解决方法
使用
require “fileutils”
相反,因为ruby-1.9.x不支持ftools