博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ruby on rails gem install pg时无法安装
阅读量:5866 次
发布时间:2019-06-19

本文共 2031 字,大约阅读时间需要 6 分钟。

gem install pg -v '0.18.2'Building native extensions.  This could take a while...ERROR:  Error installing pg:    ERROR: Failed to build gem native extension.    current directory: /Users/bevan/.rvm/gems/ruby-2.3.0/gems/pg-0.18.2/ext/Users/bevan/.rvm/rubies/ruby-2.3.0/bin/ruby -r ./siteconf20160226-49308-30rbgs.rb extconf.rbchecking for pg_config... noNo pg_config... trying anyway. If building fails, please try again with --with-pg-config=/path/to/pg_configchecking for libpq-fe.h... noCan't find the 'libpq-fe.h header*** extconf.rb failed ***Could not create Makefile due to some reason, probably lack of necessarylibraries and/or headers.  Check the mkmf.log file for more details.  You mayneed 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/bevan/.rvm/rubies/ruby-2.3.0/bin/$(RUBY_BASE_NAME)    --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}/libTo see why this extension failed to compile, please check the mkmf.log which can be found here:  /Users/bevan/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/pg-0.18.2/mkmf.logextconf failed, exit code 1Gem files will remain installed in /Users/bevan/.rvm/gems/ruby-2.3.0/gems/pg-0.18.2 for inspection.Results logged to /Users/bevan/.rvm/gems/ruby-2.3.0/extensions/x86_64-darwin-15/2.3.0/pg-0.18.2/gem_make.out

当出现如上的错误的时候,解决方法如下

 

ubuntu:

1.  sudo apt-get install libpq-dev 2.  gem install pg

 

mac:

1. brew install postgresql2. gem install pg -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/9.4/bin/pg_config

 

转载于:https://www.cnblogs.com/musibevan/p/5220318.html

你可能感兴趣的文章
github
查看>>
mySQL使用
查看>>
拓扑排序
查看>>
[Todo]对于thrift和protobuf比较好的描述
查看>>
implement-stack-using-queues(easy,但也有思考价值)
查看>>
Linux下OpenSSL 安装图文详解
查看>>
国内能用的NTP服务器及和标准源的偏差值
查看>>
产看Linux运行时间
查看>>
MYSQL获取自增ID的四种方法
查看>>
adb常用命令
查看>>
Linux_LVM&Quota
查看>>
Python 数据结构_堆栈
查看>>
shell 命令遇到的一些问题
查看>>
leetcode -- Implement strStr()
查看>>
iOS开发中的position+anchorPoint与frame应用解释
查看>>
6.1 集合和映射--集合Set->底层基于二叉搜索树实现
查看>>
vs 快捷键
查看>>
封装redis
查看>>
在rhel7中安装mysql5.7
查看>>
vue 组件内 数组无法正常渲染$set
查看>>