[MacRuby-devel] framework cannot be loaded

Jordan K. Hubbard jkh at apple.com
Thu May 15 11:43:52 PDT 2008


Ruby has always relied on garbage collection, of course, and has  
shipped with its own collector from day one.  MacRuby simply uses the  
system's collector (libauto) instead given that the underlying objects  
are Objective-C ones (and for obvious reasons, you want all your  
objects managed by the same collector).

When you find frameworks that do not support the system GC like this,  
it's worth filing a radar against them if you genuinely need to use  
them from a collected environment (either ObjC or MacRuby) so that the  
developers can properly appreciate the need for bringing them into the  
GC world.  Merely iterating over every framework like you're doing  
would not meet the standard for such radars, however, since there are  
a LOT of frameworks in /System/Library/Frameworks, a non-trivial  
number of which represent legacy, backwards-compatibility interfaces  
for which more modern (and recommended) alternatives exist.   In other  
words, it's not worth retrofitting such frameworks to meet modern  
coding standards since anyone writing new code is discouraged from  
using them in the first place.

- Jordan

On May 15, 2008, at 11:25 AM, Eric Johnson wrote:

> Thank you for the explanation.
>
> Is there any reason why the implementation of MacRuby would require  
> garbage collection? I haven't taken a look into the source yet, and  
> am just curious if it is something simple to remove, or whether the  
> project heavily depends on it.
>
> Thanks again,
> Eric
>
> On Thu, May 15, 2008 at 1:08 PM, Ernest Prabhakar  
> <prabhaka at apple.com> wrote:
> Hi Eric,
>
> I think MacRuby requires Garbage Collection, and some of the  
> frameworks don't support that.
>
> -enp
>
>
> On May 15, 2008, at 10:53 AM, Eric Johnson wrote:
>
> Hi -
>
> I'm excited about the macruby project. I just started playing with  
> it. It's a great tool to get to know the frameworks on OS X.
>
> I created a quick script that imports all frameworks in /System/ 
> Library/Frameworks - however, it fails on some of the frameworks.  
> I'm not sure what exactly is going on. Here is some sample code:
>
> frameworks = `ls /System/Library/Frameworks/`
> frameworks.chomp!
> frameworks = frameworks.split
> frameworks.each do |f|
>  f.gsub!('.framework', '')
> end
> frameworks.each do |f|
>   framework f
> end
>
> It dies with this error:
>
> 2008-05-15 12:32:25.564 macruby[2894:10b] Error loading /System/ 
> Library/Frameworks/ICADevices.framework/ICADevices:  dlopen(/System/ 
> Library/Frameworks/ICADevices.framework/ICADevices, 265): no  
> suitable image found.  Did find:
>        /System/Library/Frameworks/ICADevices.framework/ICADevices:  
> GC capability mismatch
>        /System/Library/Frameworks/ICADevices.framework/ICADevices:  
> GC capability mismatch
> RuntimeError: framework at path `/System/Library/Frameworks/ 
> ICADevices.framework' cannot be loaded: Error  
> Domain=NSCocoaErrorDomain Code=3586 UserInfo=0x19f47b0 "The bundle  
> "ICADevices" could not be loaded because it is not compatible with  
> the current application." (dlopen_preflight(/System/Library/ 
> Frameworks/ICADevices.framework/ICADevices): no suitable image  
> found.  Did find:
>        /System/Library/Frameworks/ICADevices.framework/ICADevices:  
> GC capability mismatch
>        /System/Library/Frameworks/ICADevices.framework/ICADevices:  
> GC capability mismatch)
>        from (irb):46:in `framework'
>        from (irb):46:in `block (4 levels) in irb_binding'
>        from (irb):46:in `each'
>        from (irb):46
>        from /Library/Frameworks/MacRuby.framework/Versions/0.1/usr/ 
> lib/ruby/1.9.0/irb.rb:149:in `block (2 levels) in eval_input'
>        from /Library/Frameworks/MacRuby.framework/Versions/0.1/usr/ 
> lib/ruby/1.9.0/irb.rb:262:in `signal_status'
>        from /Library/Frameworks/MacRuby.framework/Versions/0.1/usr/ 
> lib/ruby/1.9.0/irb.rb:146:in `block in eval_input'
>        from /Library/Frameworks/MacRuby.framework/Versions/0.1/usr/ 
> lib/ruby/1.9.0/irb.rb:145:in `eval_input'
>        from /Library/Frameworks/MacRuby.framework/Versions/0.1/usr/ 
> lib/ruby/1.9.0/irb.rb:69:in `block in start'
>        from /Library/Frameworks/MacRuby.framework/Versions/0.1/usr/ 
> lib/ruby/1.9.0/irb.rb:68:in `catch'
>        from /Library/Frameworks/MacRuby.framework/Versions/0.1/usr/ 
> lib/ruby/1.9.0/irb.rb:68:in `start'
>        from /usr/local/bin/macirb:12:in `<main>'
>
> Any idea what is going on?
>
> Thanks in advance for any help.
>
> - Eric
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>
>
> _______________________________________________
> MacRuby-devel mailing list
> MacRuby-devel at lists.macosforge.org
> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.macosforge.org/pipermail/macruby-devel/attachments/20080515/a75eb7f0/attachment.htm 


More information about the MacRuby-devel mailing list