pg gem无法安装 [英] pg gem fails to install
问题描述
我想使Rails使用Cygwin使用heroku但我遇到问题,当我做
bundle安装
我确定postgres已经安装Cygwin的setup.exe但遇到了问题
gem install pg
pre>
,我不能理解错误消息。
如果这个问题很琐碎, ;这是我第一次尝试学习RoR,错误日志如下:先感谢!
/ usr / bin / ruby。 exe extconf.rb
检查pg_config ... yes
使用/ usr / bin / pg_config中的配置值
检查libpq-fe.h ...是
检查libpq / libpq-fs.h ...是
检查pg_config_manual.h ...是
检查pqconnectdb()在-lpq ...是
检查PQconnectionUsedPassword()。 ..没有
检查PQisthreadsafe()...是
检查PQprepare()...是
检查PQexecParams()...是
检查PQescapeString )...是
检查PQescapeStringConn()...是
检查PQgetCancel()...是
检查lo_create()...是
检查pg_encoding_to_char()...是
检查pg_char_to_encoding()...是
检查PQsetClientEncoding()...是
检查rb_encdb_alias()... no
检查rb_enc_alias()... no
检查libpq-fe.h中的struct pgNotify.extra ...是
检查unistd.h ...是
检查ruby / st.h ... no
检查st.h ...是
创建extconf.h
创建Makefile
make
gcc -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 / 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 / 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:在函数pgconn_connection_needs_password中:
/usr/lib/ruby/gems/1.8/gems/pg-0.13.1/ext/pg_connection.c:714:未定义引用`_PQconnectionNeedsPassword'
pg_connection.o :在函数'pgconn_connection_used_password'中:
/usr/lib/ruby/gems/1.8/gems/pg-0.13.1/ext/pg_connection.c:727:未定义引用`_PQconnectionUsedPassword'
pg_connection。 o:在函数pgconn_lotruncate中:
/usr/lib/ruby/gems/1.8/gems/pg-0.13.1/ext/pg_connection.c:2991:未定义对`_lo_truncate的引用
collect2 :ld返回1退出状态
Makefile:152:目标`pg_ext.so'的配方失败
make:*** [pg_ext.so]错误1
解决方案版本0.13的gem不支持版本低于8.3的PostgreSQL。您需要升级Postgres或安装旧的gem(例如
gem install pg -v'< 0.13'
)。
pggem遵循 PostgreSQL的版本控制政策。
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
解决方案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.
这篇关于pg gem无法安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!