使用本地扩展安装pg 1.1.3失败 [英] Installing pg 1.1.3 with native extensions fails

查看:103
本文介绍了使用本地扩展安装pg 1.1.3失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Rails应用程序上运行捆绑安装.安装在以下步骤中失败:安装具有本机扩展的pg 1.1.3

I am trying to run a bundle install on a rails app. The installation fails on the step: Installing pg 1.1.3 with native extensions

这是完整的错误日志:

current directory: /Users/velinapetrova/.rvm/gems/ruby-2.5.1/gems/pg-1.1.3/ext
/Users/velinapetrova/.rvm/rubies/ruby-2.5.1/bin/ruby -r ./siteconf20181118-57661-1vdieox.rb extconf.rb
——with-pg-config=/usr/local/Cellar/postgresql/10.5/bin/pg_config
checking for pg_config... yes
Using config values from /usr/local/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 PQsetSingleRowMode()... yes
checking for PQconninfo()... yes
checking for PQsslAttribute()... yes
checking for PQencryptPasswordConn()... yes
checking for timegm()... yes
checking for rb_gc_adjust_memory_usage()... yes
checking for PG_DIAG_TABLE_NAME in libpq-fe.h... yes
checking for unistd.h... yes
checking for inttypes.h... yes
checking for C99 variable length arrays... yes
creating extconf.h
creating Makefile

current directory: /Users/velinapetrova/.rvm/gems/ruby-2.5.1/gems/pg-1.1.3/ext
make "DESTDIR=" clean

current directory: /Users/velinapetrova/.rvm/gems/ruby-2.5.1/gems/pg-1.1.3/ext
make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
compiling pg_binary_decoder.c
compiling pg_binary_encoder.c
compiling pg_coder.c
pg_coder.c:206:34: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        res = this->dec_func(this, val, RSTRING_LEN(argv[0]), tuple, field, ENCODING_GET(argv[0]));
              ~~~~                      ^~~~~~~~~~~~~~~~~~~~
/Users/velinapetrova/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/ruby.h:975:6: note: expanded from macro 'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^~~~~~~~~~~~~~~~~~~~~~
/Users/velinapetrova/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/ruby.h:971:6: note: expanded from macro 'RSTRING_EMBED_LEN'
     (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pg_coder.c:206:34: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
        res = this->dec_func(this, val, RSTRING_LEN(argv[0]), tuple, field, ENCODING_GET(argv[0]));
              ~~~~                      ^~~~~~~~~~~~~~~~~~~~
/Users/velinapetrova/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/ruby.h:976:28: note: expanded from macro 'RSTRING_LEN'
     RSTRING(str)->as.heap.len)
     ~~~~~~~~~~~~~~~~~~~~~~^~~
2 warnings generated.
compiling pg_connection.c
compiling pg_copy_coder.c
pg_copy_coder.c:225:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                        strlen = RSTRING_LEN(subint);
                                               ~ ^~~~~~~~~~~~~~~~~~~
/Users/velinapetrova/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/ruby.h:975:6: note: expanded from macro 'RSTRING_LEN'
     RSTRING_EMBED_LEN(str) : \
     ^~~~~~~~~~~~~~~~~~~~~~
/Users/velinapetrova/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/ruby.h:971:6: note: expanded from macro 'RSTRING_EMBED_LEN'
     (long)((RBASIC(str)->flags >> RSTRING_EMBED_LEN_SHIFT) & \
     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
pg_copy_coder.c:225:15: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                                        strlen = RSTRING_LEN(subint);
                                               ~ ^~~~~~~~~~~~~~~~~~~
/Users/velinapetrova/.rvm/rubies/ruby-2.5.1/include/ruby-2.5.0/ruby/ruby.h:976:28: note: expanded from macro 'RSTRING_LEN'
     RSTRING(str)->as.heap.len)
     ~~~~~~~~~~~~~~~~~~~~~~^~~
pg_copy_coder.c:531:23: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
                input_len = end_ptr - start_ptr;
                          ~ ~~~~~~~~^~~~~~~~~~~
3 warnings generated.
compiling pg_errors.c
compiling pg_result.c
compiling pg_text_decoder.c
pg_text_decoder.c:693:14: error: variable has incomplete type 'struct tm'
                        struct tm tm;
                                  ^
pg_text_decoder.c:693:11: note: forward declaration of 'struct tm'
                        struct tm tm;
                               ^
pg_text_decoder.c:705:19: warning: implicit declaration of function 'timegm' is invalid in C99 [-Wimplicit-function-declaration]
                                time_t time = timegm(&tm);
                                              ^
pg_text_decoder.c:723:13: warning: implicit declaration of function 'mktime' is invalid in C99 [-Wimplicit-function-declaration]
                                        time = mktime(&tm);
                                               ^
pg_text_decoder.c:725:13: warning: implicit declaration of function 'timegm' is invalid in C99 [-Wimplicit-function-declaration]
                                        time = timegm(&tm);
                                               ^
3 warnings and 1 error generated.
make: *** [pg_text_decoder.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/velinapetrova/.rvm/gems/ruby-2.5.1/gems/pg-1.1.3 for inspection.
Results logged to /Users/velinapetrova/.rvm/gems/ruby-2.5.1/extensions/x86_64-darwin-17/2.5.0/pg-1.1.3/gem_make.out

An error occurred while installing pg (1.1.3), and Bundler cannot continue.
Make sure that `gem install pg -v '1.1.3' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  pg

运行gem install pg -v '1.1.3' --source 'https://rubygems.org/'会产生相同的错误消息. 我已经重新安装了postgres. 我已经设置好bundle.config指向正确的pg_config文件.

Running the gem install pg -v '1.1.3' --source 'https://rubygems.org/' produces the same error message. I have reinstalled postgres. I have set up my bundle.config to point to the correct pg_config file.

推荐答案

sudo apt-get install postgresql-client libpq5 libpq-dev

这篇关于使用本地扩展安装pg 1.1.3失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆