简体   繁体   English

将Ruby打包到独立的Mac OS X应用程序?

[英]Package Ruby to a standalone Mac OS X application?

I know Python has py2app . 我知道Python有py2app I was wondering if Ruby has anything like that. 我想知道Ruby是否有类似的东西。 I know there is OCRA (One-Click Ruby Application builder) for Windows, but what about for Mac OS X? 我知道有适用于Windows的OCRA (一键式Ruby应用程序构建器),但对于Mac OS X呢?

Take a look at Platypus ; 看看鸭嘴兽 ; it may do what you want. 它可以做你想要的。

From its homepage: 从它的主页:

Platypus is a developer tool for the Mac OS X operating system. Platypus是Mac OS X操作系统的开发工具。 It can be used to create native, flawlessly integrated Mac OS X applications from interpreted scripts such as shell scripts or Perl and Python programs. 它可用于从解释脚本(如shell脚本或Perl和Python程序)创建本机,完美集成的Mac OS X应用程序。 This is done by wrapping the script in an application bundle directory structure along with an executable binary that runs the script. 这是通过将脚本与运行脚本的可执行二进制文件一起包装在应用程序包目录结构中来完成的。

Edit per @XtraSimplicity in a comment: Platypus can't handle any input or output from stdin or stdout . 在评论中根据@XtraSimplicity进行编辑 :Platypus无法处理来自stdinstdout任何输入或输出。 That will rule it out in some cases. 在某些情况下,这将排除它。

MacRuby seems like the most likely candidate without knowing more details about what you're doing. MacRuby似乎是最有可能的候选人而不了解你正在做什么的更多细节。 It can make standalone native binaries. 它可以创建独立的本机二进制文件。

http://www.macruby.org/ for more info. http://www.macruby.org/了解更多信息。

RubyCocoa包含一个脚本(standaloneify.rb),用于将项目使用的所有Ruby文件打包到app包装器中,而MacRuby(推荐用于10.5+)则编译为本机代码,因此制作独立应用程序的工作不再多于与Objective-C。

Compared to Windows, Ruby and Python are prebuilt for Mac OS X, so the easiest way might be using Cocoa with Ruby. 与Windows相比,Ruby和Python是为Mac OS X预先构建的,因此最简单的方法可能是使用Cocoa和Ruby。 You can get good information out of the book Programming Cocoa with Ruby . 您可以通过Ruby使用Programming Cocoa这本书获得很好的信息。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM