pg gem 安装失败

发布于 2025-01-07 14:04:15 字数 2478 浏览 1 评论 0原文

我正在尝试使用heroku让Rails与Cygwin一起工作,但是当我这样做时我遇到了问题

bundle install

我很确定postgres已安装(我从Cygwin的setup.exe安装了标题中带有“postgres”的所有内容,但遇到了的问题

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

I'm trying to get Rails working with Cygwin using heroku but I'm running into problem when I do

bundle install

I'm pretty sure postgres is installed (I installed everything with 'postgres' in its title from Cygwin's setup.exe but am running into problems with

gem install pg

, and I can't make sense of the error messages.

Apologies if this problem is trivial; it's my first time trying to learn RoR. Error log is below. Thanks in advance!

/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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

云胡 2025-01-14 14:04:15

gem 0.13 版本不支持 8.3 之前的 PostgreSQL 版本。您需要升级 Postgres 或安装较旧的 gem(例如,gem install pg -v '<0.13')。

'pg' gem 遵循 PostgreSQL 的版本控制策略

Version 0.13 of the gem doesn't support versions of PostgreSQL older than 8.3. You'll either need to upgrade your Postgres or install an older gem (e.g., gem install pg -v '< 0.13').

The 'pg' gem follows PostgreSQL's versioning policy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文