Using SqlAnywhere 12 client, Ruby 2.1.5, Rails 4 and macOS Sierra. I think this problem started after upgrading to Sierra. I have been using SqlAnywhere Client successfully for 2-3 years.
After upgrading (I think), the driver (DBCApi) couldn't load anymore. I have sourced sa_config.sh as always. Does anyone have experienced this problem before?
asked 13 Jan, 05:49
Assuming sa_config.sh is setting up your environment correctly, there are a couple of things I can think of that might be affecting you. One is 'System Integrity Protection' introduced by Apple in El Capitan. With it, if you are using binaries provided by Apple such as /usr/bin/ruby then the OS strips away certain environment variables (such as the DYLD_LIBRARY_PATH set by sa_config.sh) when it launches the executable and that means Ruby will not be able to find dbcapi. Apple's stated solution for this is for applications to ship their own version of such executables. Some patches related to this have been made to SQLA shortly after El Capitan came out so make sure you have a recent version of SQLA. You would still need your own copy of Ruby.
If you are using an App that bundles Ruby plus SQLA together then there is a possibility that you are affected by a security feature Apple added to Sierra called Gatekeeper Path Randomization. With that, certain Apps cannot reach outside of their App bundle since their load path is randomized. Whether an App gets its path randomized depends on how you acquired and installed your App. Apps from the Apple store, ones that are installed via signed Apple Installer packages, or come from signed .dmg images are not affected (.dmg signing is new to Sierra). If you downloaded Ruby from the internet and (believe it or not) dragged just the App into the Applications folder, the App is unaffected. If you dragged the App plus at least one other file onto your system in the same, it will be subjected to path randomization. The work-around is to drag the App and its related resources one at a time. Supposedly, Apps that were installed before an upgrade to Sierra are unaffected but I've personally experienced at least one case where that was not true.
answered 13 Jan, 09:10