libmysqlclient.so missing from MySQL binary
I worked on this for ages, reinstalled Ruby, MySQL and Rails at least three times each and tried to compile the mysql gem with all different varieties above. None worked – either I would get a compilation error (with the—with-mysql-dir variety) or the compilation would seem to go fine, for the Rails server inadvertently then to crash on a “Missing Symbol” error. For a technology promising to bring up web development productivity 10 fold, this was extremely discouraging.
What turned out to be the problem? The compiler needs the libmysqlclient.so (?) mysql library file to build the gem against. But each of the Mac OS X binaries I installed from MySQL .com, are distributed without this library. So no wonder the compiler could not compile successfully: it is missing a key component that is simply not installed when you are following the installation instructions (install the latest MySQL binary) above. I’m wondering why I seem to be the first to notice this?
Anyway, the solution takes a bit more time but is relatively simple. In stead of installing a binary, scroll down the MySQL distribution list and download the source code distribution. Follow the instructions in the INSTALL file to install this copy on your system, just remember to do ‘sudo make install’ in stead of ‘make install’ I even installed it on a different location /opt/mysql so as not to overwrite my standard binary installation on /usr/local/mysql . Afterwards the instructions above (sudo gcc_select … , sudo gem install …) work like a charm and my Ruby on Rails is finally working now.
For the people maintaining the installation packages and gems – has nobody ever noticed that this key libmysqlclient.so file is missing from the MacOSX binary of MySQL?
I dont understand why you have to install Apple Developer tools. Ruby is already on Mac OS X – out of the box.
-Alex