PG和捆绑软件安装过程中均出现错误

托尼·加埃塔(Tony Gaeta)

我在第一个RoR教程的最后一课中,被指示打开终端和输入 install bundle

结果:

tonys-mbp:crumblr Tony-MBP$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using rake 10.3.2
Using i18n 0.6.11
Using json 1.8.1
Using minitest 5.4.2
Using thread_safe 0.3.4
Using tzinfo 1.2.2
Using activesupport 4.1.6
Using builder 3.2.2
Using erubis 2.7.0
Using actionview 4.1.6
Using rack 1.5.2
Using rack-test 0.6.2
Using actionpack 4.1.6
Using mime-types 2.4.1
Using mail 2.6.1
Using actionmailer 4.1.6
Using activemodel 4.1.6
Using arel 5.0.1.20140414130214
Using activerecord 4.1.6
Using bundler 1.7.3
Using coffee-script-source 1.8.0
Using execjs 2.2.1
Using coffee-script 2.3.0
Using thor 0.19.1
Using railties 4.1.6
Using coffee-rails 4.0.1
Using hike 1.2.3
Using multi_json 1.10.1
Using jbuilder 2.2.2
Using jquery-rails 3.1.2
/Users/Tony-MBP/.rvm/gems/ruby-2.1.3/gems/bundler-1.7.3/lib/bundler.rb:302: warning: Insecure world writable dir /usr/local in PATH, mode 040777

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /Users/Tony-MBP/.rvm/rubies/ruby-2.1.3/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/Tony-MBP/.rvm/rubies/ruby-2.1.3/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}/lib

extconf failed, exit code 1

Gem files will remain installed in /Users/Tony-MBP/.rvm/gems/ruby-2.1.3/gems/pg-0.17.1 for inspection.
Results logged to /Users/Tony-MBP/.rvm/gems/ruby-2.1.3/extensions/x86_64-darwin-13/2.1.0/pg-0.17.1/gem_make.out
An error occurred while installing pg (0.17.1), and Bundler cannot continue.
Make sure that `gem install pg -v '0.17.1'` succeeds before bundling.

因此,我尝试安装pg,以便继续使用Bundler。但是,输入以下内容时会出现此错误gem install pg -v '0.17.1'

结果:

tonys-mbp:crumblr Tony-MBP$ gem install pg
Building native extensions.  This could take a while...
/Users/Tony-MBP/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /usr/local in PATH, mode 040777
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

    /Users/Tony-MBP/.rvm/rubies/ruby-2.1.3/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/Tony-MBP/.rvm/rubies/ruby-2.1.3/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}/lib

extconf failed, exit code 1

Gem files will remain installed in /Users/Tony-MBP/.rvm/gems/ruby-2.1.3/gems/pg-0.17.1 for inspection.
Results logged to /Users/Tony-MBP/.rvm/gems/ruby-2.1.3/extensions/x86_64-darwin-13/2.1.0/pg-0.17.1/gem_make.out

谁能帮忙确定为什么这两个都失败了?感谢您为他的开发者初期阶段的工作提供帮助。

编辑:

从@Lidan尝试建议的代码后,这就是我得到的:

Building native extensions with: '--with-pg-config=/Applications/Postgres.app/Contents/MacOS/bin/pg_config'
    This could take a while...
    /Users/Tony-MBP/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/rubygems/ext/builder.rb:73: warning: Insecure world writable dir /usr/local in PATH, mode 040777
    ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.
托尼·加埃塔(Tony Gaeta)

经过进一步研究,OS X Mavericks在使用pg或捆绑包宝石时表现不佳。

对我有用的四步修复程序:

brew update
brew install postgresql
gem install pg
bundle install

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Rails安装过程中的错误

来自分类Dev

mscore字体安装过程中出现错误

来自分类Dev

phpmyadmin 安装过程中出现错误 1064 (42000)

来自分类Dev

软件包安装过程中与.libPaths的混淆

来自分类Dev

在组件安装过程中调试软件包

来自分类Dev

如何在安装过程中始终信任软件?

来自分类Dev

在Strapi安装过程的依赖项安装过程中出现错误

来自分类Dev

ubuntu-restricted-extras安装过程中的错误

来自分类Dev

在安装过程中绑定/ var

来自分类Dev

安装过程中随机冻结

来自分类Dev

安装过程中的加密

来自分类Dev

我正在安装OROCRM,所以在安装过程中出现错误

来自分类Dev

Windows 7由于安装过程中出现分区错误而拒绝安装

来自分类Dev

我正在安装OROCRM,所以在安装过程中出现错误

来自分类Dev

setuptools在安装过程中发现错误的软件包

来自分类Dev

如何解决“错误:指定的转换无效。” 安装过程中出现错误?

来自分类Dev

React项目中的Tailwind-在安装过程中出现“无法找到模块'autoprefixer'”错误

来自分类Dev

wsnet模拟器:安装过程中出现分段错误(核心已转储)

来自分类Dev

在SQL Server安装过程中出现错误代码1608?

来自分类Dev

在Ubuntu Server 16.04的KVM Guest安装过程中出现错误“找不到hvm内核”

来自分类Dev

16.04安装过程中出现错误“无法显示此视频模式”

来自分类Dev

安装过程中出现“[Errno 5] 输入/输出错误”

来自分类Dev

在系统安装过程中澄清第三方软件选件

来自分类Dev

在系统安装过程中澄清第三方软件选件

来自分类Dev

在软件包安装过程中如何更改文件夹权限

来自分类Dev

如果在软件包安装过程中apt中断,会发生什么?

来自分类Dev

在软件包安装过程中如何设置环境变量

来自分类Dev

在Debian软件包安装过程中重命名文件

来自分类Dev

带有黑色禁止图标和???的消息框 ??? 在Edubuntu安装过程中出现

Related 相关文章

  1. 1

    Rails安装过程中的错误

  2. 2

    mscore字体安装过程中出现错误

  3. 3

    phpmyadmin 安装过程中出现错误 1064 (42000)

  4. 4

    软件包安装过程中与.libPaths的混淆

  5. 5

    在组件安装过程中调试软件包

  6. 6

    如何在安装过程中始终信任软件?

  7. 7

    在Strapi安装过程的依赖项安装过程中出现错误

  8. 8

    ubuntu-restricted-extras安装过程中的错误

  9. 9

    在安装过程中绑定/ var

  10. 10

    安装过程中随机冻结

  11. 11

    安装过程中的加密

  12. 12

    我正在安装OROCRM,所以在安装过程中出现错误

  13. 13

    Windows 7由于安装过程中出现分区错误而拒绝安装

  14. 14

    我正在安装OROCRM,所以在安装过程中出现错误

  15. 15

    setuptools在安装过程中发现错误的软件包

  16. 16

    如何解决“错误:指定的转换无效。” 安装过程中出现错误?

  17. 17

    React项目中的Tailwind-在安装过程中出现“无法找到模块'autoprefixer'”错误

  18. 18

    wsnet模拟器:安装过程中出现分段错误(核心已转储)

  19. 19

    在SQL Server安装过程中出现错误代码1608?

  20. 20

    在Ubuntu Server 16.04的KVM Guest安装过程中出现错误“找不到hvm内核”

  21. 21

    16.04安装过程中出现错误“无法显示此视频模式”

  22. 22

    安装过程中出现“[Errno 5] 输入/输出错误”

  23. 23

    在系统安装过程中澄清第三方软件选件

  24. 24

    在系统安装过程中澄清第三方软件选件

  25. 25

    在软件包安装过程中如何更改文件夹权限

  26. 26

    如果在软件包安装过程中apt中断,会发生什么?

  27. 27

    在软件包安装过程中如何设置环境变量

  28. 28

    在Debian软件包安装过程中重命名文件

  29. 29

    带有黑色禁止图标和???的消息框 ??? 在Edubuntu安装过程中出现

热门标签

归档