浏览 5022 次
锁定老帖子 主题:OCRA
精华帖 (2) :: 良好帖 (13) :: 新手帖 (0) :: 隐藏帖 (0)
|
|
---|---|
作者 | 正文 |
发表时间:2009-07-01
最后修改:2009-07-02
http://rubyforge.org/projects/ocra
http://github.com/larsch/ocra (水果党和 linuser 先站一边去 ……) One-Click Ruby Application,就是把解释器、gem 什么的打包在一起做成独立 exe。 比 rubyscript2exe 和 exerb 先进,支持 1.9。 安装: gem install ocra 或者下载 stand alone not complex 的 .exe 假设要把 testo.rb 做成 exe,只需: ocra.rb.bat testo.rb 输出看起来像这样(它把用到的东西都打包到 exe 里面了): === Loading script to check dependencies testo vooo === Building testo.exe m src a src\testo.rb m bin a bin\ruby.exe a bin\msvcr100-ruby191.dll a bin\MSVCR100.dll m lib m lib\ruby m lib\ruby\1.9.1 m lib\ruby\1.9.1\i386-mswin32_100 m lib\ruby\1.9.1\i386-mswin32_100\enc a lib\ruby\1.9.1\i386-mswin32_100\enc\encdb.so a lib\ruby\1.9.1\i386-mswin32_100\enc\euc_kr.so a lib\ruby\1.9.1\i386-mswin32_100\enc\gb2312.so m lib\ruby\1.9.1\i386-mswin32_100\enc\trans a lib\ruby\1.9.1\i386-mswin32_100\enc\trans\transdb.so a lib\ruby\1.9.1\i386-mswin32_100\enc\gbk.so a lib\ruby\1.9.1\rubygems.rb e RUBYOPT rubygems e RUBYLIB l bin\ruby.exe ruby.exe \src\testo.rb === Compressing === Finished (Final size was 781622) - 只有 781k 的 standalone 一些琐碎的东西: set path=d:\Ruby\ruby1.9.1\bin;%path% ocra.rb.bat mainscript.rb someimage.jpeg docs/ unless defined? Ocra app.main_loop end Dir.chdir File.dirname __FILE__ 可用选项: --dll dllname 将额外的 dll 包含进 bin 目录 --no-lzma 取消可执行文件的 LZMA 压缩(体积大一点,运行是否快一点就看你硬盘不是/是 SSD 了) --quiet 格林..达姆自己 --help 显示帮助 --windows 产生窗口程序(rubyw.exe) --console 产生控制台程序(ruby.exe) --no-autoload 不预先加载/包含脚本文件的 autoloads(感觉对速度没什么影响) --icon <ico> 自定图标 --version 显示版本号 声明:ITeye文章版权属于作者,受法律保护。没有作者书面许可不得转载。
推荐链接
|
|
返回顶楼 | |
发表时间:2009-07-01
很好用啊..
引用 === Building test_rest_google.exe m src a src\test_rest_google.rb m bin a bin\ruby.exe a bin\msvcrt-ruby18.dll a bin\zlib1.dll m lib m lib\ruby m lib\ruby\gems m lib\ruby\gems\1.8 m lib\ruby\gems\1.8\specifications a lib\ruby\gems\1.8\specifications\ocra-1.1.1.gemspec a lib\ruby\gems\1.8\specifications\json-1.1.4.gemspec m lib\ruby\site_ruby m lib\ruby\site_ruby\1.8 m lib\ruby\site_ruby\1.8\rubygems a lib\ruby\site_ruby\1.8\rubygems\rubygems_version.rb a lib\ruby\site_ruby\1.8\rubygems\defaults.rb m lib\ruby\1.8 m lib\ruby\1.8\i386-mswin32 a lib\ruby\1.8\i386-mswin32\thread.so a lib\ruby\1.8\thread.rb a lib\ruby\1.8\i386-mswin32\etc.so a lib\ruby\1.8\i386-mswin32\rbconfig.rb a lib\ruby\site_ruby\1.8\rubygems\exceptions.rb a lib\ruby\site_ruby\1.8\rubygems\requirement.rb a lib\ruby\site_ruby\1.8\rubygems\version.rb a lib\ruby\site_ruby\1.8\rubygems\dependency.rb a lib\ruby\site_ruby\1.8\rubygems\gem_path_searcher.rb a lib\ruby\site_ruby\1.8\rubygems\user_interaction.rb a lib\ruby\site_ruby\1.8\rubygems\platform.rb a lib\ruby\site_ruby\1.8\rubygems\specification.rb a lib\ruby\site_ruby\1.8\rubygems\source_index.rb a lib\ruby\site_ruby\1.8\rubygems\builder.rb a lib\ruby\1.8\i386-mswin32\stringio.so m lib\ruby\1.8\yaml a lib\ruby\1.8\yaml\error.rb a lib\ruby\1.8\i386-mswin32\syck.so a lib\ruby\1.8\yaml\ypath.rb a lib\ruby\1.8\yaml\basenode.rb a lib\ruby\1.8\yaml\syck.rb a lib\ruby\1.8\yaml\tag.rb a lib\ruby\1.8\yaml\stream.rb a lib\ruby\1.8\yaml\constants.rb a lib\ruby\1.8\rational.rb m lib\ruby\1.8\date a lib\ruby\1.8\date\format.rb a lib\ruby\1.8\date.rb a lib\ruby\1.8\yaml\rubytypes.rb a lib\ruby\1.8\yaml\types.rb a lib\ruby\1.8\yaml.rb a lib\ruby\1.8\i386-mswin32\Win32API.so a lib\ruby\site_ruby\1.8\rubygems\config_file.rb a lib\ruby\site_ruby\1.8\rubygems\custom_require.rb a lib\ruby\1.8\fileutils.rb a lib\ruby\site_ruby\1.8\rubygems.rb a lib\ruby\site_ruby\1.8\ubygems.rb a lib\ruby\1.8\prettyprint.rb a lib\ruby\1.8\pp.rb m lib\ruby\gems\1.8\gems m lib\ruby\gems\1.8\gems\json-1.1.4 m lib\ruby\gems\1.8\gems\json-1.1.4\lib m lib\ruby\gems\1.8\gems\json-1.1.4\lib\json a lib\ruby\gems\1.8\gems\json-1.1.4\lib\json\version.rb a lib\ruby\gems\1.8\gems\json-1.1.4\lib\json\common.rb m lib\ruby\gems\1.8\gems\json-1.1.4\ext m lib\ruby\gems\1.8\gems\json-1.1.4\ext\json m lib\ruby\gems\1.8\gems\json-1.1.4\ext\json\ext a lib\ruby\gems\1.8\gems\json-1.1.4\ext\json\ext\parser.so a lib\ruby\gems\1.8\gems\json-1.1.4\ext\json\ext\generator.so a lib\ruby\gems\1.8\gems\json-1.1.4\lib\json\ext.rb a lib\ruby\gems\1.8\gems\json-1.1.4\lib\json.rb a lib\ruby\1.8\i386-mswin32\socket.so a lib\ruby\1.8\timeout.rb m lib\ruby\1.8\net a lib\ruby\1.8\net\protocol.rb m lib\ruby\1.8\uri a lib\ruby\1.8\uri\common.rb a lib\ruby\1.8\uri\generic.rb a lib\ruby\1.8\uri\ftp.rb a lib\ruby\1.8\uri\http.rb a lib\ruby\1.8\uri\https.rb a lib\ruby\1.8\uri\ldap.rb a lib\ruby\1.8\uri\mailto.rb a lib\ruby\1.8\uri.rb a lib\ruby\1.8\net\http.rb m lib\ruby\site_ruby\1.8\google-rest a lib\ruby\site_ruby\1.8\google-rest\google_search.rb a lib\ruby\site_ruby\1.8\google-rest\google_result.rb a lib\ruby\site_ruby\1.8\google-rest\google_result_set.rb a lib\ruby\site_ruby\1.8\google-rest.rb m lib\ruby\site_ruby\1.8\i386-msvcrt a lib\ruby\site_ruby\1.8\i386-msvcrt\zlib.so a lib\ruby\1.8\parsedate.rb a lib\ruby\1.8\time.rb a lib\ruby\site_ruby\1.8\rubygems\remote_fetcher.rb a lib\ruby\site_ruby\1.8\rubygems\spec_fetcher.rb e RUBYOPT -rubygems e RUBYLIB l bin\ruby.exe ruby.exe \src\test_rest_google.rb === Compressing === Finished (Final size was 527881) 但是在exe执行结束后弹出一个"正在删除".. |
|
返回顶楼 | |
发表时间:2009-07-01
"正在删除" 是因为它先建了一个目录,将所有需要的东西都 copy 到目录下,再给目录打包,打完包就删掉这个目录 …… 参见 rdoc readme ……
|
|
返回顶楼 | |
发表时间:2010-06-23
m src
a src\controller.rb m bin a bin\ruby.exe a bin\msvcrt-ruby18.dll m lib m lib\GTK m lib\GTK\bin a lib\GTK\bin\libglib-2.0-0.dll a lib\GTK\bin\intl.dll a bin\iconv.dll a lib\GTK\bin\libgobject-2.0-0.dll a lib\GTK\bin\libgthread-2.0-0.dll a bin\libiconv2.dll a lib\GTK\bin\libatk-1.0-0.dll a lib\GTK\bin\libcairo-2.dll a lib\GTK\bin\libfontconfig-1.dll a lib\GTK\bin\xmlparse.dll a lib\GTK\bin\xmltok.dll a lib\GTK\bin\libfreetype-6.dll a bin\zlib1.dll a lib\GTK\bin\libpng12.dll a lib\GTK\bin\libpango-1.0-0.dll a lib\GTK\bin\libgmodule-2.0-0.dll a lib\GTK\bin\libpangocairo-1.0-0.dll a lib\GTK\bin\libpangoft2-1.0-0.dll a lib\GTK\bin\libpangowin32-1.0-0.dll a lib\GTK\bin\libgdk-win32-2.0-0.dll a lib\GTK\bin\libgdk_pixbuf-2.0-0.dll a lib\GTK\bin\libgtk-win32-2.0-0.dll m lib\GTK\lib m lib\GTK\lib\gtk-2.0 m lib\GTK\lib\gtk-2.0\2.10.0 m lib\GTK\lib\gtk-2.0\2.10.0\engines a lib\GTK\lib\gtk-2.0\2.10.0\engines\libwimp.dll m lib\GTK\lib\pango m lib\GTK\lib\pango\1.5.0 m lib\GTK\lib\pango\1.5.0\modules a lib\GTK\lib\pango\1.5.0\modules\pango-basic-win32.dll m lib\GTK\lib\gtk-2.0\2.10.0\immodules a lib\GTK\lib\gtk-2.0\2.10.0\immodules\im-ime.dll m lib\ruby m lib\ruby\gems m lib\ruby\gems\1.8 m lib\ruby\gems\1.8\specifications a lib\ruby\gems\1.8\specifications\log4r-1.1.7.gemspec a lib\ruby\gems\1.8\specifications\ocra-1.1.3.gemspec a lib\ruby\gems\1.8\specifications\gettext-2.1.0.gemspec a lib\ruby\gems\1.8\specifications\locale-2.0.5.gemspec m lib\ruby\site_ruby m lib\ruby\site_ruby\1.8 m lib\ruby\site_ruby\1.8\rubygems a lib\ruby\site_ruby\1.8\rubygems\defaults.rb m lib\ruby\1.8 m lib\ruby\1.8\i386-mingw32 a lib\ruby\1.8\i386-mingw32\thread.so a lib\ruby\1.8\thread.rb a lib\ruby\1.8\i386-mingw32\etc.so a lib\ruby\1.8\i386-mingw32\rbconfig.rb a lib\ruby\site_ruby\1.8\rubygems\exceptions.rb a lib\ruby\site_ruby\1.8\rubygems\version.rb a lib\ruby\site_ruby\1.8\rubygems\requirement.rb a lib\ruby\site_ruby\1.8\rubygems\dependency.rb a lib\ruby\site_ruby\1.8\rubygems\gem_path_searcher.rb a lib\ruby\site_ruby\1.8\rubygems\user_interaction.rb a lib\ruby\site_ruby\1.8\rubygems\platform.rb a lib\ruby\site_ruby\1.8\rubygems\specification.rb a lib\ruby\site_ruby\1.8\rubygems\source_index.rb a lib\ruby\site_ruby\1.8\rubygems\builder.rb a lib\ruby\1.8\i386-mingw32\Win32API.so a lib\ruby\site_ruby\1.8\rubygems\config_file.rb a lib\ruby\site_ruby\1.8\rubygems\custom_require.rb a lib\ruby\site_ruby\1.8\rubygems.rb a lib\ruby\1.8\i386-mingw32\socket.so a lib\ruby\1.8\prettyprint.rb a lib\ruby\1.8\pp.rb m lib\ruby\site_ruby\1.8\i386-msvcrt a lib\ruby\site_ruby\1.8\i386-msvcrt\glib2.so m lib\ruby\gems\1.8\gems m lib\ruby\gems\1.8\gems\locale-2.0.5 m lib\ruby\gems\1.8\gems\locale-2.0.5\lib m lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale m lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\util a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\util\memoizable.rb m lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag\simple.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag\irregular.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag\common.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag\rfc.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag\cldr.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag\posix.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\tag.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\taglist.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale\version.rb a lib\ruby\gems\1.8\gems\locale-2.0.5\lib\locale.rb m lib\ruby\gems\1.8\gems\gettext-2.1.0 m lib\ruby\gems\1.8\gems\gettext-2.1.0\lib m lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\version.rb m lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\runtime a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\runtime\class_info.rb m lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\core_ext a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\core_ext\string.rb a lib\ruby\1.8\i386-mingw32\iconv.so a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\core_ext\iconv.rb a lib\ruby\1.8\i386-mingw32\stringio.so a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\runtime\mofile.rb a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\runtime\locale_path.rb a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\runtime\textdomain.rb a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\runtime\textdomain_group.rb a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext\runtime\textdomain_manager.rb a lib\ruby\gems\1.8\gems\gettext-2.1.0\lib\gettext.rb a lib\ruby\site_ruby\1.8\glib2.rb a lib\ruby\site_ruby\1.8\i386-msvcrt\atk.so a lib\ruby\site_ruby\1.8\atk.rb a lib\ruby\site_ruby\1.8\i386-msvcrt\cairo.so m lib\ruby\site_ruby\1.8\cairo m lib\ruby\site_ruby\1.8\cairo\context a lib\ruby\site_ruby\1.8\cairo\context\quad.rb a lib\ruby\site_ruby\1.8\cairo\context\rectangle.rb a lib\ruby\site_ruby\1.8\cairo\context\circle.rb a lib\ruby\site_ruby\1.8\cairo\context\path.rb a lib\ruby\site_ruby\1.8\cairo\context.rb a lib\ruby\site_ruby\1.8\cairo.rb a lib\ruby\site_ruby\1.8\i386-msvcrt\pango.so a lib\ruby\site_ruby\1.8\pango.rb a lib\ruby\site_ruby\1.8\i386-msvcrt\gtk2.so a lib\ruby\site_ruby\1.8\i386-msvcrt\gdk_pixbuf2.so a lib\ruby\site_ruby\1.8\gdk_pixbuf2.rb m lib\ruby\site_ruby\1.8\gtk2 a lib\ruby\site_ruby\1.8\gtk2\base.rb a lib\ruby\site_ruby\1.8\gtk2.rb m lib\ruby\1.8\yaml a lib\ruby\1.8\yaml\error.rb a lib\ruby\1.8\i386-mingw32\syck.so a lib\ruby\1.8\yaml\ypath.rb a lib\ruby\1.8\yaml\basenode.rb a lib\ruby\1.8\yaml\syck.rb a lib\ruby\1.8\yaml\tag.rb a lib\ruby\1.8\yaml\stream.rb a lib\ruby\1.8\yaml\constants.rb a lib\ruby\1.8\rational.rb m lib\ruby\1.8\date a lib\ruby\1.8\date\format.rb a lib\ruby\1.8\date.rb a lib\ruby\1.8\yaml\rubytypes.rb a lib\ruby\1.8\yaml\types.rb a lib\ruby\1.8\yaml.rb a src\lib.rb a src\userinfo.rb m lib\ruby\gems\1.8\gems\log4r-1.1.7 m lib\ruby\gems\1.8\gems\log4r-1.1.7\src m lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\config.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\base.rb a lib\ruby\1.8\singleton.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\repository.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\logevent.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\loggerfactory.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\staticlogger.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\logger.rb m lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter\outputterfactory.rb m lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\formatter a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\formatter\formatter.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter\outputter.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter\iooutputter.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter\fileoutputter.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter\consoleoutputters.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter\staticoutputter.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\outputter\rollingfileoutputter.rb a lib\ruby\1.8\monitor.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\GDC.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\MDC.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\NDC.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r\formatter\patternformatter.rb a lib\ruby\gems\1.8\gems\log4r-1.1.7\src\log4r.rb a src\global.rb a src\view.rb a lib\ruby\1.8\i386-mingw32\zlib.so a lib\ruby\1.8\fileutils.rb a lib\ruby\1.8\timeout.rb m lib\ruby\1.8\net a lib\ruby\1.8\net\protocol.rb m lib\ruby\1.8\uri a lib\ruby\1.8\uri\common.rb a lib\ruby\1.8\uri\generic.rb a lib\ruby\1.8\uri\ftp.rb a lib\ruby\1.8\uri\http.rb a lib\ruby\1.8\uri\https.rb a lib\ruby\1.8\uri\ldap.rb a lib\ruby\1.8\uri\mailto.rb a lib\ruby\1.8\uri.rb a lib\ruby\1.8\net\http.rb a lib\ruby\1.8\parsedate.rb a lib\ruby\1.8\time.rb a lib\ruby\site_ruby\1.8\rubygems\remote_fetcher.rb a lib\ruby\site_ruby\1.8\rubygems\errors.rb a lib\ruby\site_ruby\1.8\rubygems\spec_fetcher.rb e RUBYOPT e RUBYLIB D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:445:in `w rite': Illegal byte sequence (Errno::EILSEQ) from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:445:in `puts' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:445:in `setenv' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:325:in `build_exe' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:400:in `initialize' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:392:in `open' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:392:in `initialize' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:264:in `new' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:264:in `build_exe' from D:/Program/Ruby18/lib/ruby/gems/1.8/gems/ocra-1.1.3/bin/ocra:461 from D:/Program/Ruby18/bin/ocra:19 没生成出来,郁闷啊,只能先用exerb了 |
|
返回顶楼 | |