Ruby Gem安装pg工作,但bundle安装失败
关于这方面的话题很多,但我已经尝试了几乎所有的话题,但都没有成功 我在Mac OS X 10.9.4 Mavericks上,我有Postgres.app,它可以正常工作,Ruby Gem安装pg工作,但bundle安装失败,ruby,macos,postgresql,ruby-on-rails-4,Ruby,Macos,Postgresql,Ruby On Rails 4,关于这方面的话题很多,但我已经尝试了几乎所有的话题,但都没有成功 我在Mac OS X 10.9.4 Mavericks上,我有Postgres.app,它可以正常工作,sudo gem install pg也可以工作: Building native extensions. This could take a while... Successfully installed pg-0.17.1 invalid options: -f fivefish (invalid options are
sudo gem install pg
也可以工作:
Building native extensions. This could take a while...
Successfully installed pg-0.17.1
invalid options: -f fivefish
(invalid options are ignored)
Parsing documentation for pg-0.17.1
Done installing documentation for pg after 2 seconds
1 gem installed
但是当我尝试捆绑安装时
我的错误与其他人的错误相同
- 我已经尝试了
然后bundle config build.pg——使用pg config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_-config
bundle安装
- 我有Xcode命令行工具
返回哪个psql
/Applications/Postgres.app/Contents/Versions/9.3/bin/psql
返回哪些postgres
/Applications/postgres.app/Contents/Versions/9.3/bin/postgres
捆绑包安装的错误:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.3/bin/pg_config
Using config values from /Applications/Postgres.app/Contents/Versions/9.3/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
--with-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
Gem files will remain installed in /var/folders/07/my1cl5xj7g9cknnp3y2zg_rh0000gn/T/bundler20140723-29399-1o0uzqn/pg-0.17.1/gems/pg-0.17.1 for inspection.
Results logged to /var/folders/07/my1cl5xj7g9cknnp3y2zg_rh0000gn/T/bundler20140723-29399-1o0uzqn/pg-0.17.1/extensions/universal-darwin-13/2.0.0/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.
几天后,我终于找到了问题的根源(讽刺的是,当我决定放弃,继续前进时)
当我做一个
哪个捆绑包和哪个gem
它们不是来自同一个ruby安装。
bundle来自rbenv,gem来自预安装的ruby on mac osx。可能存在权限问题。可以使用:
sudo bundle安装--没有任何内容--路径供应商/缓存您能更详细地介绍一下吗?我也有同样的问题-您采取了哪些步骤来解决这个问题?如果我的记忆良好,我会用rbenv重新安装所有这些步骤。宝石包也是