首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Rails需要pg 0.10.0,但我只能安装pg 0.10.1

Rails需要pg 0.10.0,但我只能安装pg 0.10.1
EN

Stack Overflow用户
提问于 2011-03-20 04:31:42
回答 1查看 807关注 0票数 0

我使用的是Mac。如果我运行的是sudo env ARCHFLAGS="-arch i386" gem install pg,它就能正常工作。然而,当我试图在浏览器中访问我的Rails项目时,我得到了这个错误:

代码语言:javascript
复制
Could not find pg-0.10.0 in any of the sources (Bundler::GemNotFound)

如果我卸载0.10.1并尝试安装0.10.0,我会得到如下结果:

代码语言:javascript
复制
$ sudo env ARCHFLAGS="-arch i386" gem install pg --version 0.10.0
Password:
Building native extensions.  This could take a while...
ERROR:  Error installing pg:
    ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
checking for pg_config... yes
Ruby cflags: "-arch i386 -g -Os -pipe -fno-common -DENABLE_DTRACE  -fno-common  -pipe -fno-common  "
MacOS X build: fixing architecture flags:
  using the value in ARCHFLAGS environment variable ("-arch i386").
  finding flags common to both Ruby and PostgreSQL...
  testing for architecture: "ppc"
  testing for architecture: "i386"
  common arch flags: -arch i386
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
    --without-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=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    --with-pg
    --without-pg
    --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


Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/pg-0.10.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/pg-0.10.0/ext/gem_make.out

我并不关心是否能找到让Rails接受pg 0.10.1的方法,或者是否能找到安装pg 0.10.0的方法,但我需要这样做。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-03-20 04:35:56

您的Gemfile.lock中是否列出版本0.10.0?如果是这样的话,假设您的Gemfile没有指定版本0.10.0,那么您应该能够通过运行bundle update pg来更新Rails正在查找的版本。

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/5364718

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档