Rails хочет pg 0.10.0, но я могу установить только pg 0.10.1 - PullRequest
0 голосов
/ 19 марта 2011

Я работаю в Mac OS X. Если я запускаю sudo env ARCHFLAGS="-arch i386" gem install pg, все работает просто отлично. Тем не менее, я получаю эту ошибку при попытке посетить мой проект Rails в браузере:

Could not find pg-0.10.0 in any of the sources (Bundler::GemNotFound)

Если я затем удалю 0.10.1 и попытаюсь установить 0.10.0, я получу это:

$ 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, но мне нужно сделать одно или другое.

1 Ответ

1 голос
/ 19 марта 2011

В вашем Gemfile.lock указана версия 0.10.0?Если это так, вы сможете обновить версию, которую ищет Rails, запустив bundle update pg, предполагая, что ваша Gemfile также не указывает версию 0.10.0.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...