繁体   English   中英

安装gem pg时出错

[英]Error with install gem pg

我正在尝试运行“bundle install”,我在我的Gemfile中唯一的数据库gem是pg,所以我收到以下错误。

bundle install
Fetching gem metadata from https://rubygems.org/...........
Fetching additional metadata from https://rubygems.org/..
Resolving dependencies...
...

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/MacOS/bin/pg_config
sh: /Applications/Postgres.app/Contents/MacOS/bin/pg_config: No such file or directory
sh: /Applications/Postgres.app/Contents/MacOS/bin/pg_config: No such file or directory
checking for libpq-fe.h... yes
...
creating extconf.h
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling gvl_wrappers.c
compiling pg.c
compiling pg_connection.c
compiling pg_errors.c
compiling pg_result.c
linking shared-object pg_ext.bundle
clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]
clang: note: this will be a hard error (cannot be downgraded to a warning) in the future
make: *** [pg_ext.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/marklalich/.bundler/tmp/14076/gems/pg-0.17.1 for inspection.
Results logged to /Users/marklalich/.bundler/tmp/14076/extensions/universal-darwin-13/2.0.0/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.

我在网上找不到任何东西,请有人帮忙!

谢谢!!

我有同样的问题,我的修复是先设置捆绑配置设置:

bundle config build.pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config

不要挂在pg宝石上。 执行此捆绑包配置后执行捆绑安装修复了“make failed”问题。

作为参考,这是帮助https://stackoverflow.com/a/9235107/3546680的答案,但它是user944938的答案给了我正确的路径。感谢并希望它也帮助其他人!

你是怎么安装postgres的。 您可以使用postgresapp.com上的postgres应用安装postgres。 将其放入应用程序目录并配置pg gem的路径。 gem install pg - --with-pg-config = / Applications / Postgres.app / Contents / Versions / 9.3 / bin / pg_config

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM