【发布时间】:2019-10-18 20:19:14
【问题描述】:
我一直在尝试安装一个说要使用的 api
bundle install
rails s
但是当我做捆绑时,我得到了这个错误:
An error occurred while installing pg (0.18.1), and Bundler cannot
continue. Make sure that `gem install pg -v '0.18.1' --source 'https://rubygems.org/'`succeeds before bundling.
但是当我运行 gem install 命令时,我得到了这个:
错误:安装 pg 时出错: 错误:无法构建 gem 原生扩展。
current directory: /Library/Ruby/Gems/2.3.0/gems/pg-0.18.1/ext /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20191018-63874-el2g8s.rb extconf.rb 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... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.
并且 mkmf.log 文件说:
ld: warning: directory not found for option '-L/BuildRoot/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.13.Internal.sdk/usr/local/libressl/lib'
我不确定从哪里开始,因为我已经在网上遵循了大量其他指南,但它们要么不起作用,要么导致我出现新的错误。
【问题讨论】:
-
你安装了xcode吗?如果没有,你需要。
标签: ruby rubygems bundle homebrew pg