gpt4 book ai didi

ruby-on-rails - Postgresql gem install pg 0.18.4 通过,bundle 安装失败

转载 作者:行者123 更新时间:2023-11-29 13:53:31 25 4
gpt4 key购买 nike

Mac 操作系统 El Capitan

捆绑安装失败:

compiling pg_connection.c
pg_connection.c:2394:3: warning: implicit declaration of function 'gettimeofday' is invalid in C99 [-Wimplicit-function-declaration]
gettimeofday(&currtime, NULL);
^
1 warning generated.
compiling pg_copy_coder.c
compiling pg_errors.c
compiling pg_result.c
compiling pg_text_decoder.c
compiling pg_text_encoder.c
compiling pg_type_map.c
compiling pg_type_map_all_strings.c
compiling pg_type_map_by_class.c
compiling pg_type_map_by_column.c
compiling pg_type_map_by_mri_type.c
compiling pg_type_map_by_oid.c
compiling pg_type_map_in_ruby.c
compiling util.c
linking shared-object pg_ext.bundle
ld: file not found: dynamic_lookup
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [pg_ext.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/jmintz/Documents/LaunchAngels/radar/vendor/bundle/gems/pg-0.18.4 for inspection.
Results logged to /Users/jmintz/Documents/LaunchAngels/radar/vendor/bundle/extensions/x86_64-darwin-15/2.2.0-static/pg-0.18.4/gem_make.out

......

An error occurred while installing pg (0.18.4), and Bundler cannot continue.

Make sure that `gem install pg -v '0.18.4'` succeeds before bundling.

运行 'gem install pg -v '0.18.4' 结果:

Building native extensions.  This could take a while...
Successfully installed pg-0.18.4
Parsing documentation for pg-0.18.4
Done installing documentation for pg after 4 seconds
1 gem installed

但是再次运行“bundle install”失败了。有什么建议么?我试过用自制软件卸载并重新安装 postgresql,但没有成功

最佳答案

我现在在 macOS Catalina 上遇到了类似的错误,但我无法成功运行

gem install pg -v '0.18.4'

我在帮助我解决问题的 puma gem(我知道这是另一个 gem)中发现了这个问题:https://github.com/puma/puma/issues/2304 .

在那里,我发现了这个:

Clang now enables -Werror=implicit-function-declaration by default:

Clang now reports an error when you use a function without an explicitdeclaration when building C or Objective-C code for macOS(-Werror=implicit-function-declaration flag is on). This additionalerror detection unifies Clang’s behavior for iOS/tvOS and macOS 64-bittargets for this diagnostic. (49917738)

还有这个:

gem install puma:4.3.5 -- --with-cflags="-Wno-error=implicit-function-declaration"

因此,我能够使用以下方法构建 pg:

gem install pg -v '0.18.1' -- --with-cflags="-Wno-error=implicit-function-declaration"

关于ruby-on-rails - Postgresql gem install pg 0.18.4 通过,bundle 安装失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36455625/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com