gpt4 book ai didi

ruby-on-rails - Rubymine pg安装错误

转载 作者:太空宇宙 更新时间:2023-11-03 16:44:08 25 4
gpt4 key购买 nike

我一直在为一个小型 rails 项目试用 Rubymine,并且非常希望调试能够正常工作。该项目是一个 Rails API,使用在我的 Mac 上运行的 Postgres 和 El Capitan。我遇到的问题是 Rubymine 提示“SDK 中找不到 Rails”

我认为解决这个问题的方法是从 Rubymine 菜单运行 bundle install。然而,在安装 pg 时始终失败:

....
Using hashie 3.4.3
Using multi_json 1.11.2
Using multi_xml 0.5.5
Using newrelic_rpm 3.14.2.312
Installing pg 0.18.4 with native extensions


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


/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20160617-92261-aw26bh.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.

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/2.0/usr/bin/ruby
--with-pg
--without-pg
--enable-windows-cross
--disable-windows-cross
--with-pg-config
--without-pg-config
--with-pg_config
--without-pg_config
--with-pg-dir
--without-pg-dir
--with-pg-include
--without-pg-include=${pg-dir}/include
--with-pg-lib
--without-pg-lib=${pg-dir}/
--with-pqlib
--without-pqlib
--with-libpqlib
--without-libpqlib
--with-ms/libpqlib
--without-ms/libpqlib

extconf failed, exit code 1

...
Using faraday 0.9.2
Using hashie-forbidden_attributes 0.1.1
Using httparty 0.13.7
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.

我已经尝试过许多关于堆栈溢出的其他解决方案,包括: Bundler::GemNotFound: Could not find rake-10.3.2 in any of the sources An error occurred while installing pg (0.17.1), and Bundler cannot continue

并使用应用程序和 brew 在我的机器上安装了 postgres(我认为)。

任何使这项工作可行的想法都将不胜感激!

最佳答案

我认为错误与 RubyMine 无关;我认为这与系统有关。

也就是说,如果您在命令行上执行 gem install pg,我怀疑您会遇到同样的错误。

我使用 rvm 并且它可以正常工作。它安装必要的系统库。 (也就是说,其他人有时会遇到困难。)

如果您对使用 rvm 感兴趣,请在谷歌上搜索“install rvm”以获取安装说明的链接。

也就是说,您应该确保为您的项目配置 RubyMine,以使用您在命令行中使用的相同 Ruby。这样,您将在两种环境中获得一致的结果。

还有。仅供引用,您可以发送电子邮件至 support@jetbrains.com 询问有关 RubyMine 的问题。

关于ruby-on-rails - Rubymine pg安装错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37871064/

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