Help installing mysql and postgres gems via Bundler
I'm an experienced developer, but a complete Rails newb. I'm trying to install an existing app that uses the Bundler gem to encapsulate and control the application environment and, after about 3 days of fighting with it, I can't seem to get the environment put together. The bundler Gemfile specifies the use of both mysql and postgres because we develop with mysql, but test and deploy against postgres.
I'm running OS X 10.6.2 with MySQL and PostgreSQL installed via MacPorts (packages: mysql5, mysql5-server, postgresql84 and postgresql84-server). I can get the mysql gem to install (and work) fine using the following:
sudo env ARCHFLAGS="-arch x86_64" gem bundle -- --with-mysql-dir=/opt/local/lib/mysql5 --with-mysql-lib=/opt/local/lib/mysql5/mysql --with-mysql-includ开发者_开发知识库e=/opt/local/include/mysql5/mysql'
Unfortunately, I can't seem to figure out how to get PostgreSQL to install. I've tried just extending the working MySQL command above with:
sudo env ARCHFLAGS="-arch x86_64" gem bundle -- --with-mysql-dir=/opt/local/lib/mysql5 --with-mysql-lib=/opt/local/lib/mysql5/mysql --with-mysql-include=/opt/local/include/mysql5/mysql -- --with-pgsql-lib=/opt/local/lib/postgresql84 --with-pgsql-include=/opt/local/include/postgresql84
No love. I'm probably missing something obvious and simple, but I just can't see it. Anyone have any ideas? Any thoughts would be much appreciated.
Thanks.
Okay, so installing the pg
gem instead of the postgres
gem did the trick. I guess the former is newer? Or perhaps native. I read the reason somewhere, but can't remember where. It still requires the ARCHFLAG
, but I was able to install the gem without the other options.
精彩评论