From: Wladjmir Wlj Date: 2008-03-23T19:26:34+09:00 Subject: Re: XCode, Mac OS X, Ruby C Extension Laurent Sansonetti wrote: > Hi, > > The Xcode template will produce an extension that may only work for > the version of Ruby that ships with the system. I don't know why it > doesn't work with the version in MacPorts, could you provide more > feedback about this (like a backtrace)? Maybe it's because the > extension is built 2-way fat (for i386 and ppc) by default. > > Anyway if you want to write an extension that should be portable with > different versions of Ruby, as others suggested you should use mkmf. > > Laurent Thanks all, i unistalled macport version of ruby... the simple way. Just curious,it disturb me that my extension could not work on another machine, and i do not understand why, afterall the ruby source files are the same. if i build manually with extconf -> make it work with both, then the problem is some configuration on XCode? i would like to use RubyCocoa for some project so i want to learn something more about how it works with ruby. i already tried to build only i38, the only error i get is BUS ERROR - Abort trap follow the crash report : Process: ruby [2450] Path: /opt/local/bin/ruby Identifier: ruby Version: ??? (???) Code Type: X86 (Native) Parent Process: ruby [2441] Date/Time: 2008-03-22 12:32:58.152 +0100 OS Version: Mac OS X 10.5.2 (9C31) Report Version: 6 Exception Type: EXC_BAD_ACCESS (SIGABRT) Exception Codes: KERN_PROTECTION_FAILURE at 0x0000000000000000 Crashed Thread: 0 Thread 0 Crashed: 0 libSystem.B.dylib 0x911e80ea __kill + 10 1 libSystem.B.dylib 0x9125f3f2 raise + 26 2 libSystem.B.dylib 0x9126e9af abort + 73 3 libruby.dylib 0x000eb970 rb_exc_new + 0 4 libruby.dylib 0x0015b4b6 sigbus + 54 5 libSystem.B.dylib 0x911e65eb _sigtramp + 43 6 ??? 0xffffffff 0 + 4294967295 7 libruby.1.dylib 0x0034db48 rb_intern + 43 8 libruby.1.dylib 0x00309d83 rb_define_module + 32 9 RubyCExtTry.bundle 0x000a5f55 Init_RubyCExtTry + 27 (RubyCExtTry.c:20) 10 libruby.dylib 0x000e9e4e dln_load + 190 11 libruby.dylib 0x00107704 rb_require_safe + 1044 12 libruby.dylib 0x000f9492 rb_call0 + 706 13 libruby.dylib 0x000fa0ac rb_call + 284 14 libruby.dylib 0x000f6a71 rb_eval + 4929 15 libruby.dylib 0x00107a77 ruby_exec_internal + 151 16 libruby.dylib 0x00107ab6 ruby_exec + 22 17 libruby.dylib 0x00107aea ruby_run + 42 18 ruby 0x00001ffd 0x1000 + 4093 19 ruby 0x00001f96 start + 54 Thread 0 crashed with X86 Thread State (32-bit): eax: 0x00000000 ebx: 0x9126e96f ecx: 0xbfffdf6c edx: 0x911e80ea edi: 0xa00fe650 esi: 0x00000016 ebp: 0xbfffdf88 esp: 0xbfffdf6c ss: 0x0000001f efl: 0x00000282 eip: 0x911e80ea cs: 0x00000007 ds: 0x0000001f es: 0x0000001f fs: 0x00000000 gs: 0x00000037 cr2: 0x00000000 Binary Images: 0x1000 - 0x1ffc +ruby ??? (???) /opt/local/bin/ruby 0x91000 - 0x92fff +plist.bundle ??? (???) /Applications/Editors/TextMate.app/Contents/SharedSupport/Support/lib/osx/plist.bundle 0xa1000 - 0xa1ffa +wait.bundle ??? (???) /opt/local/lib/ruby/1.8/i686-darwin9.2.0/io/wait.bundle 0xa5000 - 0xa5ffc +RubyCExtTry.bundle ??? (???) /Users/wladj/RubyCExtTry/build/Release/RubyCExtTry.bundle 0xda000 - 0x185ffb +libruby.dylib ??? (???) /opt/local/lib/libruby.dylib 0x300000 - 0x39dffb libruby.1.dylib ??? (???) <7ed6bf45152b1d74844a0e3fdbba4899> /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/libruby.1.dylib 0x8fe00000 - 0x8fe2da53 dyld 96.2 (???) <7af47d3b00b2268947563c7fa8c59a07> /usr/lib/dyld 0x91001000 - 0x91139ff7 libicucore.A.dylib ??? (???) /usr/lib/libicucore.A.dylib 0x91179000 - 0x912d8ff3 libSystem.B.dylib ??? (???) <4899376234e55593b22fc370935f8cdf> /usr/lib/libSystem.B.dylib 0x912d9000 - 0x9140bfef com.apple.CoreFoundation 6.5.1 (476.10) /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation 0x924b8000 - 0x924bffe9 libgcc_s.1.dylib ??? (???) /usr/lib/libgcc_s.1.dylib 0x9258c000 - 0x92590fff libmathCommon.A.dylib ??? (???) /usr/lib/system/libmathCommon.A.dylib 0x94755000 - 0x94780fe7 libauto.dylib ??? (???) <42d8422dc23a18071869fdf7b5d8fab5> /usr/lib/libauto.dylib 0x957f4000 - 0x95851ffb libstdc++.6.dylib ??? (???) <04b812dcec670daa8b7d2852ab14be60> /usr/lib/libstdc++.6.dylib 0x964a5000 - 0x96584fff libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib 0xfffe8000 - 0xfffebfff libobjc.A.dylib ??? (???) /usr/lib/libobjc.A.dylib 0xffff0000 - 0xffff1780 libSystem.B.dylib ??? (???) /usr/lib/libSystem.B.dylib -- Posted via http://www.ruby-forum.com/.