windows Ruby 2 exe 工具
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8666460/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Ruby 2 Exe tool
提问by user1119425
Anyone knows which tools can be used to make independent exe - file from ruby - script? I tried both exerb and rubyscript2exe. But they are obsolete and don't work properly(
任何人都知道哪些工具可用于从ruby 脚本制作独立的exe 文件?我尝试了 exerb 和 rubyscript2exe。但是它们已经过时并且不能正常工作(
exerb can't properly make exe from script file which uses "require net/http" :-( rubyscipt2exe does nothing, just nothing :-(
exerb 无法从使用“require net/http”的脚本文件正确生成 exe :-( rubyscipt2exe 什么都不做,什么也不做 :-(
回答by Jordan Running
Have you tried Ocra?
你试过奥克拉吗?
It was the first result(s) for this Google search(limited to results in the past year, which is a must for many, if not most, Ruby-related searches).
这是此 Google 搜索的第一个结果(仅限于过去一年的结果,这对于许多(如果不是大多数)与 Ruby 相关的搜索都是必须的。
回答by Brian
I also wanted to generate .exe file from my ruby script several months ago, and exerb and rubyscript2exe didn't work for me, either. Finally, I decided to use ocra, and I hope my solution can help you.
几个月前,我还想从我的 ruby 脚本生成 .exe 文件,但 exerb 和 rubyscript2exe 对我也不起作用。最后,我决定使用ocra,希望我的解决方案可以帮助您。
gem install ocra
ocra your_ruby_script.rb
宝石安装 ocra
ocra your_ruby_script.rb
if you are lucky enough, ocra should generate your_ruby_script.exe
after step2. However, I was not lucky, and I faced the following error messages when the first time I used ocra:
如果你足够幸运,ocra 应该会your_ruby_script.exe
在 step2 之后生成。然而,我并不走运,我第一次使用 ocra 时遇到了以下错误消息:
Invalid gemspec in [c:/Ruby187/lib/ruby/gems/1.8/specifications/ocra-1.3.0.gemspec]: invalid date format in specification: "2011-06-19 00:00:00.000000000Z "
Invalid gemspec in [c:/Ruby187/lib/ruby/gems/1.8/specifications/win32-autogui-0.5.0.gemspec]: invalid date format in specification: "2011-08-17 00:00:00.000000000Z" 1.8.8
Don't be disappointed. Just edit these files
不要失望。只需编辑这些文件
c:/Ruby187/lib/ruby/gems/1.8/specifications/ocra-1.3.0.gemspec
c:/Ruby187/lib/ruby/gems/1.8/specifications/win32-autogui-0.5.0.gemspec
c:/Ruby187/lib/ruby/gems/1.8/specifications/ocra-1.3.0.gemspec
c:/Ruby187/lib/ruby/gems/1.8/specifications/win32-autogui-0.5.0.gemspec
change
改变
"2011-06-19 00:00:00.000000000Z "
into "2011-06-19"
"2011-06-19 00:00:00.000000000Z "
进入 "2011-06-19"
"2011-08-17 00:00:00.000000000Z"
into "2011-08-17"
"2011-08-17 00:00:00.000000000Z"
进入 "2011-08-17"
redo step 2 after editing these files, and everything should be great now.
编辑这些文件后重做第 2 步,现在一切都应该很好了。