Oracle's instructions specify setting DYLD_LIBRARY_PATH. This makes my application dependent on random users' configuration and is very troublesome to set up.
How can I avoid having to set any environment variables?
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html
related note for linux: installing Oracle Instantclient on Linux without setting environment variables?
Oracle's instantclient installation instructions specify that the user set DYLD_LIBRARY_PATH. This is very troublesome to manage for multiple users.
To use the instantclient without setting any environment variables:
Download the instantclient distribution from oracle.com. For doing non-java software development, you will need (assuming Oracle 10.2):
Unzip the three files. This will give you a directory
Copy the files to /usr, which is one of the default places the dynamic loader searches.
If you use tnsnames.ora, copy it to /etc, which is the default global place the oracle runtime searches.
Test with
After much research I found an sustainable solution to this error, that involves editing Apache's
launchd
configuration.plist
file to specify the requiredDYLD_LIBRARY_PATH
,ORACLE_HOME
, andLD_LIBRARY_PATH
environment variables.You can view the full answer here: https://stackoverflow.com/a/20670810/1914455
If your goal is simply to run sqlplus on your MacBook, this might work for you. Remove the DYLD_LIBRARY_PATH environment variable from ~/.bashrc and replace it with an alias:
alias sqlplus="DYLD_LIBRARY_PATH=/Applications/instantclient_11_2 sqlplus"
Blog entry: sqlplus and DYLD_LIBRARY_PATH on Mac OS/X