【发布时间】:2013-02-03 17:43:42
【问题描述】:
我正在运行OSX 10.8.2,Xcode 安装了命令行工具。
我正在尝试捆绑,并且在一些宝石上(我将在底部指定)我得到以下内容:
ERROR: Failed to build gem native extension
...
Could not create Makefile due to some reason
到目前为止,我在gem 'pg' 和gem 'binding_of_caller' 上遇到了错误
我认为该错误与无法创建 Makefile 有关,但找不到任何有助于解决该错误的内容。我在下面粘贴了完整的错误:
我不知道该怎么办。
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby 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... 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.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
--with-pg
--without-pg
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/lib
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib
Gem files will remain installed in /Users/ericavirtue/.bundler/tmp/75812/gems/pg-0.14.1 for inspection.
Results logged to /Users/ericavirtue/.bundler/tmp/75812/gems/pg-0.14.1/ext/gem_make.out
An error occurred while installing pg (0.14.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.1'` succeeds before bundling.
编辑:我正在使用 rbenv 管理 ruby 版本,它说我正在运行 1.9.3 -p385系统 ruby 是旧版本,但据我所知,这不重要。
我通过homebrew 安装了postgresql
编辑 2:
我尝试切换到 RVM 进行 ruby 管理,但又出现了一个 make 错误:
Error running 'make -j2', please read ... ruby-1.9.3-p385/make.log
There has been an error while running make. Halting the installation.
文件make.log不存在...
【问题讨论】:
标签: ruby-on-rails ruby makefile gem osx-mountain-lion