Mac OSX上pg gem的安裝問題

作一個rails應用,說好的用mysql結果後端最後用了postgresql,在mac上配置出了各類問題。 mysql

使用bundle install安裝包,發現缺乏pg沒法安裝,在網上找了一圈解決方案,發現原來我用brew安裝PostgresSQL很差解決問題,因而改用直接的發行包。從http://postgresapp.com/上下載應用,直接拖拽安裝。 sql

在安裝pg gem時使用命令 shell

env ARCHFLAGS="-arch x86_64" gem install pg -- --with-pg-config=/Applications/Postgres93.app/Contents/MacOS/bin/pg_config

注意,若是你應用的名稱,原來爲Postgres,如今已經更名爲Postgres93 後端

再次安裝pg gem app

gem install pg

成功 post

相關文章
相關標籤/搜索