From: Nit Khair Date: 2008-11-04T20:04:01+09:00 Subject: Re: Roguelike project? Charles Oliver Nutter wrote: > Nit Khair wrote: >> Nit Khair wrote: >> >>>> NameError: uninitialized constant FFI::Platform::ARCH_ >>> Or maybe it does not work on OS X yet. >> >> It supports "darwin", but not the "powerpc" cpu. > > Probably just some missing build flags; libffi, on which it's based, > does support Darwin on PPC. > > Jump on Ruby-FFI lists if you think you can help debug and get it > working: > > http://kenai.com/projects/ruby-ffi > > - Charlie The problem comes here (line 28 of platform.rb). ARCH = case CPU.downcase when /i?86|x86|i86pc/ "i386" when /amd64|x86_64/ "x86_64" else 28. raise FFI::PlatformError, "Unknown cpu architecture: #{ARCH_}" end When i checked my rbconfig.rb I have "powerpc" as the "host_cpu". So, I changed platform.rb to : - when /i?86|x86|i86pc/ + when /i?86|x86|i86pc|powerpc/ ... and now your sample works fine! Thanks. Forgive me for being spoilt, but is there some script that takes a header file, or C source and generates the attach_function lines ? -- Posted via http://www.ruby-forum.com/.