2012-02-22 139 views
2

我試圖讓Rails的使用Heroku的使用Cygwin工作,但我快到的時候我做PG寶石無法安裝

bundle install 

我敢肯定的Postgres安裝的問題(我安裝了一切與「Postgres的從Cygwin的SETUP.EXE它的標題,但我遇到了問題,

gem install pg 

,我不能讓這些錯誤信息的意識

道歉,如果這個問題是平凡的;它我第一次嘗試學習RoR。錯誤日誌如下。提前致謝!

/usr/bin/ruby.exe extconf.rb 
checking for pg_config... yes 
Using config values from /usr/bin/pg_config 
checking for libpq-fe.h... yes 
checking for libpq/libpq-fs.h... yes 
checking for pg_config_manual.h... yes 
checking for PQconnectdb() in -lpq... yes 
checking for PQconnectionUsedPassword()... no 
checking for PQisthreadsafe()... yes 
checking for PQprepare()... yes 
checking for PQexecParams()... yes 
checking for PQescapeString()... yes 
checking for PQescapeStringConn()... yes 
checking for PQgetCancel()... yes 
checking for lo_create()... yes 
checking for pg_encoding_to_char()... yes 
checking for pg_char_to_encoding()... yes 
checking for PQsetClientEncoding()... yes 
checking for rb_encdb_alias()... no 
checking for rb_enc_alias()... no 
checking for struct pgNotify.extra in libpq-fe.h... yes 
checking for unistd.h... yes 
checking for ruby/st.h... no 
checking for st.h... yes 
creating extconf.h 
creating Makefile 

make 
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-cygwin -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/us /include -g -O2 -pipe -fno-strict-aliasing -c pg.c 
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-cygwin -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -g -O2 -pipe -fno-strict-aliasing -c pg_connection.c 
gcc -I. -I. -I/usr/lib/ruby/1.8/i386-cygwin -I. -DRUBY_EXTCONF_H=\"extconf.h\" -I/usr/include -g -O2 -pipe -fno-strict-aliasing -c pg_result.c 
gcc -shared -s -o pg_ext.so pg.o pg_connection.o pg_result.o -L. -L/usr/lib -L. -L/usr/lib -Wl,--enable-auto-image-base,--enable-auto-import,--export-all -lruby -lpq -lrt -ldl -lcrypt 
pg_connection.o: In function 'pgconn_connection_needs_password': 
/usr/lib/ruby/gems/1.8/gems/pg-0.13.1/ext/pg_connection.c:714: undefined reference to `_PQconnectionNeedsPassword' 
pg_connection.o: In function 'pgconn_connection_used_password': 
/usr/lib/ruby/gems/1.8/gems/pg-0.13.1/ext/pg_connection.c:727: undefined reference to `_PQconnectionUsedPassword' 
pg_connection.o: In function 'pgconn_lotruncate': 
/usr/lib/ruby/gems/1.8/gems/pg-0.13.1/ext/pg_connection.c:2991: undefined reference to `_lo_truncate' 
collect2: ld returned 1 exit status 
Makefile:152: recipe for target `pg_ext.so' failed 
make: *** [pg_ext.so] Error 1 
+0

它看起來像安裝鏈接到一個過時的庫,如果我讀了這個:http://archives.postgresql.org/pgsql-general/2011-01/msg00580.php正確。 – ScottJShea 2012-02-22 19:02:14

回答

2

版本0.13的gem不支持PostgreSQL版本比8.3更舊。您需要升級您的Postgres或安裝較舊的寶石(例如,gem install pg -v '< 0.13')。

'pg'寶石如下PostgreSQL's versioning policy

+0

這固定它;感謝你的回答!爲了解決問題,我仍然有點困惑。我很確定我安裝了最新版本的Postgres。 – jwang 2012-03-07 05:32:33