Never been to CodeSnippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)

About this user

Mark James Adams http://raysend.com/mark/

1 total

Install postgres gem on Mac OS X 10.5 (Leopard)

When upgrading or installing recent versions of the postgres ruby gem on Leopard the following error appears

	===========   WARNING   ===========

		You are building this extension on OS X without setting the
		ARCHFLAGS environment variable, and PostgreSQL does not appear
		to have been built as a universal binary. If you are seeing this
		message, that means that the build will probably fail.

		Try setting the environment variable ARCHFLAGS
		to '-arch i386' before building.

		For example:
		(in bash) $ export ARCHFLAGS='-arch i386'
		(in tcsh) $ setenv ARCHFLAGS '-arch i386'

		Then try building again.

		===================================


The trick is to set the ARCHFLAGS variable inside the sudo command using env.

sudo env ARCHFLAGS="-arch i386" gem install postgres
1 total