Aug
31
2010
Snow Leopard does not have the mysql gem installed, and my last solution for installing it only work in OS X prior to 10.6.4; therefore, when you see the following error:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Install the mysql gem with these steps:
- Download and install the latest version of MacPorts if not already installed
- Run the following commands to install mysql5 and the associated ruby gem
# sudo port install mysql5-server
# sudo env ARCHFLAGS="-arch x86_64" gem install mysql
1 comment | tags: Gem, OS X, Ruby on Rails, Snow Leopard | posted in Software Tools
Sep
6
2009
NOTE: See my latest post for a solution for OS X 10.6.4 and later
A fresh Snow Leopard (OS X 10.6) install does not have the mysql gem installed, and installing it fails because of missing header files:
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb install mysql
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
To correctly install the mysql gem:
- Download and install the MySQL package.
- Install XCode that’s bundled with Snow Leopard
- Install the gem for your architecture (use -arch i386 if you have an Intel Core Solo or Intel Core Duo processor):
# sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql-5.1.38-osx10.5-x86_64/bin/mysql_config
3 comments | tags: Gem, OS X, Ruby on Rails, Snow Leopard | posted in Software Tools