youpy/mac-robot — pull request #1 by Watson1978 (2012-06-17 18:05:26+00:00)
Title: fix build error on MacRuby 

Thank you, awesome gems.

Unfortunately, it seems which this gem can't install on MacRuby.

```
$ sudo macgem install mac-robot
Fetching: mac-robot-0.2.2.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing mac-robot:
ERROR: Failed to build gem native extension.

/Library/Frameworks/MacRuby.framework/Versions/0.13/usr/bin/macruby extconf.rb
checking for event_dispatcher... no
creating Makefile

make
/usr/bin/gcc -fno-common -arch x86_64 -fexceptions -fno-common -pipe -O3 -g -Wall -arch x86_64 -c -o event_dispatcher.o event_dispatcher.m
/usr/bin/gcc -dynamic -bundle -undefined suppress -flat_namespace -arch x86_64 -o event_dispatcher.bundle event_dispatcher.o -L. -L/Library/Frameworks/MacRuby.framework/Versions/0.13/usr/lib -arch x86_64 -framework ApplicationServices -lmacruby
ld: Linked dylibs built for GC-only but object files built for retain/release for architecture x86_64
collect2: ld returned 1 exit status
make: *** [event_dispatcher.bundle] Error 1

Gem files will remain installed in /Library/Ruby/Gems/MacRuby/0.13/gems/mac-robot-0.2.2 for inspection.
Results logged to /Library/Ruby/Gems/MacRuby/0.13/gems/mac-robot-0.2.2/ext/event_dispatcher/gem_make.out
```

MacRuby need GC flag for Ruby C extension using Objective-C.
https://github.com/MacRuby/MacRuby/wiki/Loading-Objective-C-Frameworks-and-Bundles

```ruby
require "mkmf"
$CFLAGS << ' -fobjc-gc ' # use a GC
```

Cheers