[MacRuby-devel] MacRuby questions
Hello all, I'm an experienced Mac developer trying to add Ruby to my toolbox. Most of my previous experience is with Python, Tcl, Objective-C, and AppleScript, and I'd like to add Ruby as well. My interest in MacRuby stems in large part because it appears to have vastly superior app deployment tools than are found in standard Ruby, which are non-existent. I had a few questions about MacRuby and its differences from standard C-Ruby: 1. Is MacRuby mature enough to function as a drop-in replacement for standard Ruby? Are there significant gaps in functionality? Specifically, does ffi work? (I tried to run a "hello world" ruby-tk app using the ffi and ffi-tk gems, but MacRuby just segfaulted with an error code of 11.) 2. Is it possible to have a command-line toolchain/workflow for development and deployment of MacRuby apps, or is heavy use of Xcode required? Here's a bit more about my specific use case for MacRuby: I develop desktop apps using scripting languages; most of my experience to date has been with Tcl/Tk and Python/Tk, dropping down into Objective-C or C where necessary for speed or integration with specific API's, using just a basic text editor-Terminal workflow. (I'm one the maintainers of Tk on the Mac.) My apps integrate heavily into Cocoa or Carbon API's when necessary to implement stuff like NSServices, AppleScript support, etc. Both Tcl and Python have excellent support for deployment of desktop apps (Tcl has an entire standalone app environment, while Python has py2app and related tools). Standard Ruby has no such tools on the Mac whatsoever. I like the fact that MacRuby would make AppleScript support for my app easy, and the macruby_deploy tool seems to be what's missing from standard Ruby--gathering all bits and libs into an app bundle, running install_name_tool where necessary, etc. The segfault with ffi-tk, however, has me concerned (this particular lib has been advertised to work with any and all Ruby implementations including JRuby). Any guidance on these questions is apprecaited. I hope I'm able to move forward with a new app idea with MacRuby. Thanks, Kevin -- Kevin Walzer Code by Kevin http://www.codebykevin.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Re: [MacRuby-devel] OS X10.9 & MacRuby's future...
On 5/16/13 2:38 PM, Mark Villacampa wrote: The momentum around MacRuby has been inexistent for almost a year and a half. That is, since Laurent Sansonetti (the original creator of MacRuby) left Apple, and that left the project without maintainers who were being paid to work on it. Only Watson and a couple other maintainers have been doing maintenance work and fixing a couple of bugs. Since nobody is being paid to maintain it, and (AFAIK) there is no company/individual whose main/critical systems depended on MacRuby, nobody has taken over the project. This is pretty much a chicken-egg situation. It's unfortunate that MacRuby is suffering from bit-rot, but it was not an optimal solution for desktop development in any event. It was incompatible with standard Ruby in subtle ways, and was an incomplete implementation. Standard Ruby has nice bindings to several UI toolkits (Qt, Tk, wx) and can access Cocoa API's via Tim Burks' under-documented rubyobjc module, but it too has problems for desktop apps. Everything kind of falls apart when you look for available deployment tools outside of those that are tightly bound to RubyCocoa or MacRuby (i.e. standaloneify). It would be really great if someone could put together ruby2app (Ruby version of py2app) in a way that would work with any Ruby libraries, not just Cocoa ones. But I'm not going to hold my breath. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] MacRuby on Mavericks
On 11/6/13, 9:00 PM, Robert Carl Rice wrote: The iTunes Store has notified me that my current binaries will be removed from the store for not being compatible with the current OS release. Recoding for either RubyMotion or Objective-C will be a big job and I'm not looking forward to it. Can you be more specific about how they are "not compatible"? -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
[MacRuby-devel] Standard Ruby for desktop apps?
With MacRuby seemingly abandoned, is there any constituency for using standard Ruby for Mac desktop deployment? I was very interested in trying to use Ruby with Tk, but was stymied by the lack of deployment API's. Tk is old-school, but it has the virtue of actually working with standard Ruby when nearly every other Ruby UI toolkit and framework does not (wxRuby, etc.) Is there any way to abstract any of the MacRuby/Ruby-Cocoa packaging tools (such as standalonify) into a general app bundling package? --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] Standard Ruby for desktop apps?
On 11/6/13, 10:17 PM, Robert Carl Rice wrote: I don't think many app developers would want to publish their source code through the iTunes store. Another developer would quickly "swallow it up" into a larger application. I wouldn't be interested in any solution that doesn't compile the code. I certainly respect this viewpoint. However, it doesn't change the fact that MacRuby appears to lack any development leadership at this point: how long before the framework starts to suffer from bit-rot? --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
[MacRuby-devel] Trying to embed standard Ruby in an app...how does MacRuby do it?
I'm trying to embed standard Ruby 2.1 (MacPorts installed) in an app using a stub launcher that calls an embedded interpreter. I've run install_name_tool correctly on the Ruby dylib and bundles, etc., but I'm having trouble: the app is still looking in the MacPorts directory (/opt/local) for its load path. Running "strings" on my bundled Ruby dylib shows that search paths are hard-coded into the dylib itself, so install_name_tool has no effect. How did MacRuby handle this? Did MacRuby bundle the entire Ruby runtime into the app or did it rely on the system installation of MacRuby? If the latter is the case, and it simply isn't possible to make a truly relocatable Ruby app using install_name_tool, then my job is a lot easier, because Mavericks has standard Ruby (2.0) bundled in. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] Trying to embed standard Ruby in an app...how does MacRuby do it?
On 4/28/14, 8:52 AM, Shannon Love wrote: Macruby rewrote ruby from the ground up in objective-c. It installed an entirely different framework and generated it's own gems etc. When you compiled the app, you got objective-c, not ruby, at runtime. You did end up with the entire MacRuby framework in every app and IIRC, any gems you wished as well. As a result, even a very simple Macruby app had a huge disk footprint. Looks like install_name_tool's entire point is to copy a tool into a project and then alter the paths to be relative to the executable. If it's not doing that it's likely a config problem with the tool and not the nature the Ruby install. Actually, I found a configure flag for Ruby that makes this feasible: --enable-load-relative After that, I was able to do some additional jiggering with install_name_tool to get things running as expected in an app bundle. --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] How dead is dead...
On 4/28/14, 7:21 PM, Patrick Hanevold wrote: There is only the github at the moment (https://github.com/patrickhno/cocoa). If you guys have a suggestion for a particular flavor of mailing list, sure - I can set one up and participate. Patrick How does this gem compare to rubyobjc: https://github.com/timburks/rubyobjc ? -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] How dead is dead...
On 4/29/14, 10:01 AM, Patrick Hanevold wrote: OK, lets do a poll then, the target audience is right here I would guess. What's your preferred flavour of mailing list / group manager for the cocoa gem? Patrick Any way to expand the focus here? A "Ruby-Mac" list (focusing on using Ruby in general for app development on the Mac) would bring in devs from non-Cocoa frameworks. My model here is the Python-Mac SIG list, which includes PyObjC, wxPython, Python-Tkinter, PyQt and others. One reason I found MacRuby so frustrating to work with (and hence of little interest) was that it wasn't really Ruby. A lot of Ruby gems wouldn't build, you couldn't use it with other UI toolkits, and its app deployment tools could not be abstracted. One benefit of a "Ruby-Mac" list (as opposed to MacRuby) is that it allow developers from various frameworks to exchange ideas, and perhaps the community could evolve that would develop some best practices that can be used in both a Cocoa and non-Cocoa context. One immediate example is "rb2app." I'm developing a prototype tool that will allow me to deploy Ruby-Tk apps in a standalone manner. Right now it's a stub launcher written in C, a custom build of Ruby in MacPorts, and a shell script to run install_name_tool. It would be great if this could be generalized into a more useful package that can handle Ruby-Cocoa apps, and others. I'm not an expert in Ruby...still learning the language...but I like what I see in the language, its libraries, and community, and definitely want to dive in and do some real app development in it. While the tool exist for Ruby desktop app development on the Mac, there is a real poverty of deployment tools. There are two or three different such tools on Ruby for Windows but they are non-portable. By my count there are at least three actively maintained deployment tools for Python (py2app, cx_freeze, and pyinstaller). It's baffling to me why no such tool has been developed for Ruby on the Mac. The Python-Mac list supports all kinds of discussion: PyObjC, other GUI toolkits with Mac-specific quirks, general Python questions that may be specific to the Mac, and deployment questions. It would be great if this list could be similarly expanded. Cocoa would perhaps be its main focus because most of the developers are interested in that. But there should be room for others also. JRuby could also find a home here as well. Thoughts? --Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
Re: [MacRuby-devel] MacRuby application on Xcode
On 10/22/14, 9:05 PM, Sandeep Murthy wrote: I can obviously create a source file where I can write Ruby code, but I can’t seem to compile and run this directly in Xcode. MacRuby has been overtaken by bit-rot and is no longer viable. You may need to move in another direction. Here are a few options: 1. As another poster in the thread indicated, try RubyMotion, a commercial product developed by the creator of MacRuby that is essentially its successor. 2. Switch to Objective-C for developing of a Cocoa app with Xcode. 3. Use Ruby with another GUI toolkit, such as Tk: Ruby has just added support for Tk's latest version, 8.6. Tk works pretty well on the Mac, other GUI toolkits are not well-maintained on the Mac. Hope this helps, Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel
[MacRuby-devel] ANN: ruby2app, a tool for bundling Ruby scripts into standalone Mac applications
I'm pleased to announce the initial release of ruby2app, a tool for bundling Ruby scripts into standalone Mac applications: https://github.com/codebykevin/ruby2app ruby2app is a simple command-line tool, inspired by similar Mac tools like py2app for Python, that bundles a Ruby script with the Ruby runtime into a standalone Mac application. It reads a basic configuration file to find the appropriate Ruby installation, compiles a small C program that embeds the Ruby interpreter, copies the entire Ruby installation into the application bundle, and re-links the relevant libraries with the main executable. Ruby must be compiled with the "--enable-load-relative" flag for ruby2app to work. At present the tool is primarily geared for Ruby-Tk applications, since Tk is the best-supported open-source GUI framework with Ruby bindings on the Mac in 2014, and (not coincidentally) is the one I use. But I invite others to submit patches to add support for other UI frameworks as well; Qt support might be a good candidate. Support for RubyMotion is outside the scope of ruby2app, as RubyMotion presumably has its own toolchain. I am still in the process of learning Ruby, and in fact wrote this tool to be certain that I could deploy a Ruby-Tk application in a convenient manner on the Mac desktop. There are no other current tools that provide basic support for deployment of an open-source Mac application written in Ruby. Ruby-Cocoa and MacRuby are effectively dead and their tools (standaloneify.rb) are obsolete, RubyMotion has its own toolchain, and crate and rubyscript2exe do not support current versions of Ruby. I do have a decade of experience writing Mac applications in Python, Perl and Tcl using the Tk toolkit, so I adapted some ideas from bundling tools for those languages in creating ruby2app. ruby2app is written in Bash, and thus should be easy to read and modify as required, and should fit in well to any application building toolchain. ruby2app is available under the MIT license, and feedback is welcome. Thank you, Kevin -- Kevin Walzer Code by Kevin/Mobile Code by Kevin http://www.codebykevin.com http://www.wtmobilesoftware.com ___ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org https://lists.macosforge.org/mailman/listinfo/macruby-devel