我是一个完整的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>'
Run Code Online (Sandbox Code Playgroud)
欣赏有关如何解决此问题的任何想法!如果有帮助我可以发布源代码Ruby代码.
显然,我拥有的源代码很旧,即使在获得最新版本后,它仍然存在问题。但知道它在某个时候有效,我继续在 Windows 上安装旧版本的 Ruby (1.8.7-p358),然后一切正常,我能够构建并获取我的可执行文件。无论如何,这不是最优雅的解决方案。但如果有人知道最新 Windows 版本 Ruby 的 rubyscript2exe 修复程序,请回复。谢谢。