Showing posts with label OS X. Show all posts
Showing posts with label OS X. Show all posts

Sunday, December 11, 2011

installing rails on OSX with mysql

trying to install and use ruby on rails on OSX with a mysql installation made by hand in /usr/local/mysql


$ rails server/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle: dlopen(/Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle, 9): Library not loaded: /usr/local/mysql-5.5.17-osx10.6-x86/lib/libmysqlclient.18.dylib (LoadError)  
Referenced from: /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle  
Reason: no suitable image found.

I'm probably missing something about a correct installation on osx and with a correct distribution of mysql libraries but I've seen that the fastest way of getting rid of this problem was a:

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib

use the

sudo install_name_tool -change libmysqlclient.18.dylib /usr/local/mysql-5.5.15-osx10.6-x86_64/lib/libmysqlclient.18.dylib /Library/Ruby/Gems/1.8/gems/mysql2-0.3.11/lib/mysql2/mysql2.bundle

should be the proper solution

Tuesday, February 23, 2010

DBD::mysql on Leopard


I've encountered this problem

dyld: lazy symbol binding failed: Symbol not found: _mysql_init Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle Expected in: dynamic lookup

dyld: Symbol not found: _mysql_init Referenced from: /Library/Perl/5.8.8/darwin-thread-multi-2level/auto/DBD/mysql/mysql.bundle Expected in: dynamic lookup


I always have problems due to multiple installation of mysql my hand, 32 and 64 bit, and 2 different installations of perl (one coming from Leopard, the other from port).

To solve this (due to 64bit mysql libraries and missing 32bit libs) I decided to recompile DBD::mysql on my box in CPAN

CPAN> force install DBD::mysql

and apparently this solved the problem

Tuesday, August 11, 2009

lovely error message from CPAN


Undefined subroutine &Compress::Zlib::gzopen called at /opt/local/lib/perl5/5.8.8/CPAN.pm line 5721

no solution, yet!

my best wild guess is that port/CPAN has broken the installation of CPAN/port.

Should I use cpan or port ?
May I use both ?
Since I'm not binded to any version in particular I could probably u

se both...

Sunday, July 26, 2009

CPAN not working


uh, CPAN stopped working on my MacBook yesterday...
no apparent reason for that, only an error like:

Can't locate Mac/Files.pm in @INC (...)

after checking libraries and the file /Library/Perl/5.8.8/AppendToPath
I've decided to make a fresh installation of Mac::Files...

I've downloaded from:
http://search.cpan.org/~cnandor/Mac-Carbon-0.77/Files/Files.pm

and made a forced installation...

CPAN is back at work, now!

Tuesday, March 10, 2009

ImageMagick


I think ImageMagick is the right weapon for most image manipulation scripts...

I generally use mac ports to install / update it, I've found a small bug about
a mismatching checksum.

A port selfupdate solved all (since some good guy solved the checksum bug ahead)

Tuesday, February 03, 2009

installing PHP with GD on OS X


I was quite disappointed when realized that the apache+php coming with OS X was without the GD libs compiled in...

A complete recompile of both programs is needed, but this guy decided to help:
http://www.entropy.ch/software/macosx/php/
from here you can dowload an updated version of php precompiled, with some libraries included... se his pages for more details.

Apache, as usual from http://httpd.apache.org...

I paraphrased MArk's advices for compiling Apache:
CFLAGS="-isysroot /Developer/SDKs/MacOSX10.5.sdk -arch i686" sudo ./configure --prefix=/opt/apache2 --enable-mods-shared=all --enable-proxy-balancer --enable-proxy-ajp --enable-proxy-http --enable-proxy-ftp --enable-proxy-connect --enable-proxy --enable-ssl --enable-so

I've changed the location of the brand new sdk, removed the 386 arch, the ppc arch and added the i686 arch.

sudo make
sudo make install

sudo shouldn't be really necessary 'til the last step, but shouldn't harm much.

Created a conf/other directory for my configurations,
added an Include directive in the main .conf file,
added the php.conf as described in the entropy.conf

Unfortunately a nasty error message appeared on starting up the web server on a missing lib...

I needed to:
696 cd /opt/apache2/
697 sudo mkdir lib
698 cd lib
699 sudo ln -s /opt/local/lib/libexpat.0.dylib .
create the missing dir, creating a symlink to the missing library to resolve this. Dumb working solution.

Wednesday, December 03, 2008

show / unshow all files in Finder - OSX

with the command, from the Terminal:

defaults write com.apple.finder AppleShowAllFiles [ TRUE | FALSE ]

and restarting Finder (note the upcase)

killall Finder

Finder will show/unshow all the hidden files