为什么在安装gem'pg'时出现错误? [英] why do I get the error when installing the gem 'pg'?

查看:212
本文介绍了为什么在安装gem'pg'时出现错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

无法在ubuntu上安装pg gem-找不到'libpq-fe.h头文件

我正在尝试将 pg 宝石添加到我的本地环境中。 br>
但它返回此错误

I'm trying to add the gem pg to my local environment.
But it returns this error

Errno::EACCES: Permission denied - /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/.gemtest
An error occurred while installing pg (0.14.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.1'` succeeds before bundling.

我该怎么办?

之后该错误已经消失,现在返回此错误

after that error has gone, now it returns this error

Installing pg (0.14.1) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

        /Users/me/.rvm/rubies/ruby-1.9.3-p362/bin/ruby extconf.rb 
checking for pg_config... no
No pg_config... trying anyway. If building fails, please try again with
 --with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** 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
    --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/me/.rvm/rubies/ruby-1.9.3-p362/bin/ruby
    --with-pg
    --without-pg
    --with-pg-dir
    --without-pg-dir
    --with-pg-include
    --without-pg-include=${pg-dir}/include
    --with-pg-lib
    --without-pg-lib=${pg-dir}/lib
    --with-pg-config
    --without-pg-config
    --with-pg_config
    --without-pg_config


Gem files will remain installed in /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1 for inspection.
Results logged to /Users/me/.rvm/gems/ruby-1.9.3-p362/gems/pg-0.14.1/ext/gem_make.out
An error occurred while installing pg (0.14.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.14.1'` succeeds before bundling.


推荐答案

我相信您在使用sudo之前很乱

try

I believe you are messing around with sudo before
try

chown -R `whoami`:staff ~/.rvm/gems/ruby-1.9.3-p362/gems

这篇关于为什么在安装gem'pg'时出现错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆