gpt4 book ai didi

ruby-on-rails - 安装 ruby​​ gems 时无法创建 Makefile

转载 作者:数据小太阳 更新时间:2023-10-29 08:39:14 24 4
gpt4 key购买 nike

我正在运行 OSX 10.8.2,Xcode 安装有命令行工具。

我正在尝试捆绑,并在一些 gems 上(我将在底部指定)我得到以下内容:

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 -p385The system ruby​​ is an older version, but that should据我所知这无关紧要。

我通过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 不存在...

最佳答案

您需要安装 postgres。来自 http://deveiate.org/code/pg/README_rdoc.html你需要:

  • Ruby 1.8.7-p249 或 1.9.3-p0。
  • PostgreSQL 8.3.x(带有 header 、-dev 包等)。

如果你用的是brew,就

brew install postgresql

至于 binding_of_caller,您使用的是什么版本的 ruby​​?

关于ruby-on-rails - 安装 ruby​​ gems 时无法创建 Makefile,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14950787/

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