[Rails] Re: oci8 mac os x intel

KUBO Takehiro kubo at jiubao.org
Fri Apr 21 00:33:19 GMT 2006


Hi,

Lori Olson <loriolson at labradortechnologies.com> writes:

> Bryan Liles wrote:
>> Is rails + oci8 + mac os x intel a winning combination?  It appears
>> that oci8 might be a issue.
>
> OCI8 is not really the issue.  The issue is that you need an Intel 
> compatible library from Oracle (for example, an Intel version of the 
> InstantClient).
>
> Strangely, the Oracle Mac Instant Client DOES work, on it's own, through 
> the magic of Rosetta.  For instance, you can run SQLPLUS.  But you 
> can't, for example, use it with OCI, because OCI compiles as a native 
> Intel binary, and cannot link against the PPC binaries of the Oracle 
> Instant Client.
>
> If you REALLY wanted to cripple yourself, you could try to install/build 
> PPC binaries of your entire Ruby/Rails stack, and then run in 
> compatibility (read sloooooow) mode via Rosetta.  I wouldn't recommend 
> it, but you could try.

Some people have tried.

Here is what I add to the README file in the next ruby-oci8 release.

=== Intel Mac

Oracle intant client is still, when I write this, pcc.

1. check whether the ruby is ppc bianry.

      file `which ruby`

   If it is universal bianry, use ditto to extract ppc binary.

      http://blog.sven-tissot.de/daylist_html?year=2006&month=4&day=12

   If it is i386 binary, compie it as ppc.

2. fix compilation flags.

      ruby -r rbconfig -e "p Config::CONFIG['CFLAGS']"
      ruby -r rbconfig -e "p Config::CONFIG['DLDLAGS']"

   If they have '-arch i386', delete it from:
      /usr/lib/ruby/1.8/powerpc-darwin8.0/rbconfig.rb
   or
      /usr/lib/ruby/1.8/universal-darwin8.0/rbconfig.rb

   If they haven't '-arch ppc', add it.

3. config, make and install

     ruby setup.rb config -- --with-instant-client=/opt/oracle/instantclient10_1
     make
     make install

4. rollback the changes in 2.


More information about the Rails mailing list