错误gem在Mac Yosemite上安装pg

时间:2015-07-07 01:52:55

标签: ruby-on-rails ruby macos postgresql

我试图将postgresqlRuby on Rails

一起使用

但是,我输入gem install pg,它会出现错误

Provided configuration options:
    --with-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/Coda/.rvm/rubies/ruby-2.1.3/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}/lib

extconf failed, exit code 1

Gem files will remain installed in /Users/Coda/.rvm/gems/ruby-2.1.3@rails416/gems/pg-0.18.2 for inspection.
Results logged to /Users/Coda/.rvm/gems/ruby-2.1.3@rails416/extensions/x86_64-darwin-13/2.1.0/pg-0.18.2/gem_make.out

环境:Mac OSX 10.10

rails版本:Rails 4.1.8

ruby​​版本:ruby 2.1.3

1 个答案:

答案 0 :(得分:0)

首先,我在here下载并安装了(479.0),然后设置了正确的Postgres.app

Path

最后,重新输入命令

export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin