Monday, 19 October 2009

Netbeans Ruby Oracle OCI Mac Problem

Okay. You are using netbeans and connecting to Oracle. You have installed the Oracle Instant Client and have set the DYLD_LIBRARY_PATH='/instantclient' in your shell. All is well if you run your rails app from the command line.

Right.

But when you run it through Netbeans you get the error telling you to some effect:

"ERROR: ActiveRecord oracle_enhanced adapter could not load ruby-oci8 library. Please install ruby-oci8 library or gem."

The explanation is that for some reason Netbeans on the mac does not pick up the settings set say in your .bashrc file. The easiest solution is to add the line:

"source ~/.bashrc" to your netbeans startup script.

Now Netbeans will pick up all your paths.

1 comment:

RandyInLA said...

Thank you for this! Easiest solution by far to get env vars to be seen by passenger/apache.