相关疑难解决方法(0)

用Mavericks在Mac上安装PG gem是不可能的

我正在尝试安装pg gem以便再次使用我的rails项目.但我得到这个错误:

构建原生扩展.这可能需要一段时间...错误:安装pg时出错:错误:无法构建gem原生扩展.

/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb checking for pg_config... no No pg_config... trying anyway. If
Run Code Online (Sandbox Code Playgroud)

构建失败,请再次尝试使用--with -pg-config =/path/to/pg_config检查libpq-fe.h ...否找不到'libpq-fe.h header *extconf.rb失败*由于某些原因无法创建Makefile,可能缺少必要的库和/或标头.检查mkmf.log文件以获取更多详细信息.您可能需要配置选项.

提供的配置选项: - 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 =/Users/jeanosorio/.rvm/rubies/ruby​​-2.0.0-p247/bin/ruby​​ --with-pg --without-pg --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} /

Gem文件将保留在/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0中进行检查.结果记录到/Users/jeanosorio/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/gems/2.0.0/gems/pg-0.17.0/ext/gem_make.out

我尝试了在stackoverflow上找到的所有内容,但我仍然遇到此错误.

如果我尝试使用brew安装postgresql,我会得到以下警告:

警告:postgresql-9.2.4已经安装,它只是没有链接

如果我尝试链接

brew链接postgresql链接/usr/local/Cellar/postgresql/9.2.4 ...警告:无法链接postgresql.取消链接...

错误:无法符号链接文件:/usr/local/Cellar/postgresql/9.2.4/share/man/man7/WITH.7/usr/local/share/man/man7不可写.您应该更改其权限.

请帮忙

注意:我已经为小牛队安装了命令行工具.


如果我使用自制程序卸载并尝试再次安装,我收到此错误:

==>正在下载http://ftp.postgresql.org/pub/source/v9.2.4/postgresql-9.2.4.tar.bz2

################################################## ################ 100.0%

==>修补修补文件src/pl/plpython/Makefile修补文件contrib/uuid-ossp/uuid-ossp.c …

postgresql gem ruby-on-rails osx-mavericks

95
推荐指数
9
解决办法
7万
查看次数

在osx上安装pg gem时出错

我在osx 10.6.7尝试在新的rails 3.0.7应用程序上运行bundle install,并且在尝试构建pg gem时它仍然失败.它一直告诉我,我需要开发人员工具.但据我所知,我已经安装了开发人员工具.

这是xcodebuild -version的输出

Xcode 3.2.6
Component versions: DevToolsCore-1809.0; DevToolsSupport-1806.0
BuildVersion: 10M2518
Run Code Online (Sandbox Code Playgroud)

这是失败的pg gem构建的输出

/Users/bm/.rvm/rubies/ruby-1.9.2-head/bin/ruby extconf.rb --with-pg-config=/Library/PostgreSQL/8.4/bin/pg_config
Using config values from /Library/PostgreSQL/8.4/bin/pg_config
checking for libpq-fe.h... *** 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=/Users/bm/.rvm/rubies/ruby-1.9.2-head/bin/ruby
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib …
Run Code Online (Sandbox Code Playgroud)

ruby macos gem ruby-on-rails pg

13
推荐指数
6
解决办法
1万
查看次数

标签 统计

gem ×2

ruby-on-rails ×2

macos ×1

osx-mavericks ×1

pg ×1

postgresql ×1

ruby ×1