我应该重新安装PostGreSql吗?

我不得不重新安装Rails应用程序到新鲜的OSX雪豹安装。

我有一个头发拉会议只是试图获得pg gem正确安装与Rails。 首先我通过这个链接安装了PgSql 9。 但是,当试图运行软件包安装时,我开始出现错误:

Installing pg (0.10.0) with native extensions /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:529:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError) /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/bin/ruby extconf.rb checking for pg_config... yes Ruby cflags: " -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe" MacOS X build: fixing architecture flags: finding flags common to both Ruby and PostgreSQL... *** Your PostgreSQL installation doesn't seem to have an architecture in common with the running ruby interpreter (["ppc", "i386", "x86_64"] vs. []) I'll continue anyway, but if it fails, try setting ARCHFLAGS. testing for architecture: "ppc" testing for architecture: "i386" testing for architecture: "x86_64" checking for libpq-fe.h... *** 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=/Users/Chris/.rvm/rubies/ruby-1.9.2-p136/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 /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:368:in `try_do': The complier failed to generate an executable file. (RuntimeError) You have to install development tools first. from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:452:in `try_cpp' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:853:in `block in find_header' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:693:in `block in checking_for' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:280:in `block (2 levels) in postpone' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:280:in `block in postpone' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:254:in `open' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:276:in `postpone' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:692:in `checking_for' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/1.9.1/mkmf.rb:852:in `find_header' from extconf.rb:123:in `<main>' Gem files will remain installed in /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/pg-0.10.0 for inspection. Results logged to /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/pg-0.10.0/ext/gem_make.out from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:507:in `block in build_extensions' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `each' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:482:in `build_extensions' from /Users/Chris/.rvm/rubies/ruby-1.9.2-p136/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:156:in `install' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `block in run' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `block in each' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/gems/bundler-1.0.10/bin/bundle:13:in `<top (required)>' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/bin/bundle:19:in `load' from /Users/Chris/.rvm/gems/ruby-1.9.2-p136/bin/bundle:19:in `<main>' 

我遇到这篇文章 ,这表明我通过Mac端口安装PgSql 8.3。 所以我这样做了,并按照文章中的其余指示。 我设法捆绑安装,并通过rails s启动rails服务器没有任何问题。

我主要关心的是,我相信我有2个PgSql的安装。 一个是版本9和另一个版本8.3。 我应该为什么卸载版本9? 还是最新的安装覆盖?

还是我不应该担心这个? 其次,我到处search有关如何在Mac OSX上卸载版本9的正确文档,无济于事。

我不知道它在Mac上如何工作,但在Linux上,EnterpriseDB安装程序会留下卸载脚本,可能会链接到某些菜单项。 你应该找那个。

这两个设施应该能够和平共处。 但是,如果您不需要安装,则应该考虑将其移除,这是理所当然的。

一般来说,我build议使用Macports for PostgreSQL和其他软件。