【发布时间】:2016-10-18 16:07:14
【问题描述】:
我一直在为一个小型 Rails 项目尝试 Rubymine,并且非常希望调试能够正常工作。 该项目是一个 Rails API,并使用在我的 Mac 上运行的 Postgres 和 El Capitan。 我遇到的问题是 Rubymine 抱怨 'No Rails found in SDK'
我认为解决方案是从 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(我认为)。
任何关于制作这项工作的想法都将不胜感激!
【问题讨论】:
-
如果你能把整个输出贴出来(最好格式化成代码,见formatting),你会省去很多猜测。
-
你试过安装railsintaller吗?这就是我所做的,它在红宝石上效果很好
-
@grochmal 好点,我已经添加了其余的相关输出,只是没有安装所有其他 gem 的列表等
-
@Marv-C 听起来不错,但它不支持 osx el capitan,可能应该提到我也在运行它!
-
您真正需要的只是
postgres标头(和库),您的操作系统需要postgresql-dev包。
标签: ruby-on-rails ruby postgresql rubymine pg