Rails clone metasploit 个项目,bundle install 后出现的,不知道怎么解决,求指点。

jeremy16601 · 2013年11月23日 · 最后由 xstmjh 回复于 2013年11月26日 · 2727 次阅读

Gem files will remain installed in /Users/xueqingli/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/gems/2.0.0/gems/pg-0.16.0 for inspection. Results logged to /Users/xueqingli/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/gems/2.0.0/gems/pg-0.16.0/ext/gem_make.out

An error occurred while installing pg (0.16.0), and Bundler cannot continue. Make sure that gem install pg -v '0.16.0' succeeds before bundling.

那你就手动跑一下

gem install pg -v '0.16.0'

这个呗……

出错信息给得很明确了,缺少编译需要的头文件。没有安装 PG 相应的 DEV 包。

http://stackoverflow.com/questions/6040583/cant-find-the-libpq-fe-h-header-when-trying-to-install-pg-gem-on-ubuntu

if you are using postgres.app

gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config

#4 楼 @xstmjh 试过了,还是不行呢,

你确定安装了 PostgreSQL ?

brew install postgresql

#8 楼 @song940 这位是对的,你本身没有安装 postgresql 安装那个 gem 也是没用的。我曾经也是碰到这个问题。

#8 楼 @song940 这个方法也试了,不行。。。。

#10 楼 @jeremy16601 cat /Users/xueqingli/.rvm/rubies/ruby-2.0.0-p195/lib/ruby/gems/2.0.0/gems/pg-0.16.0/ext/gem_make.out

12 楼 已删除

用这个http://postgresapp.com/

然后再

gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config
需要 登录 后方可回复, 如果你还没有账号请 注册新账号