在Mac上安装do_postgres

时间:2014-05-02 00:00:28

标签: ruby-on-rails macos postgresql bundle

您好我一直在尝试安装我的Gemfile但是每次尝试都会得到这个:

Fetching gem metadata from https://rubygems.org/.........
Fetching additional metadata from https://rubygems.org/..
Using addressable 2.3.5
Using backports 3.6.0
Using bcrypt 3.1.7
Using bcrypt-ruby 3.1.5
Using daemons 1.1.9
Using dm-core 1.2.1
Using dm-aggregates 1.2.0
Using dm-constraints 1.2.0
Using dm-migrations 1.2.0
Using fastercsv 1.5.5
Using json 1.8.1
Using json_pure 1.8.1
Using multi_json 1.9.2
Using dm-serializer 1.2.2
Using dm-timestamps 1.2.0
Using dm-transactions 1.2.0
Using stringex 1.5.1
Using uuidtools 2.1.4
Using dm-types 1.2.2
Using dm-validations 1.2.0
Using data_mapper 1.2.0
Using data_objects 0.10.14
Using dm-do-adapter 1.2.0

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

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb 
checking for main() in -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.h... yes
checking for mb/pg_wchar.h... no
*** 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/2.0/usr/bin/ruby
    --with-pgsql-server-dir
    --without-pgsql-server-dir
    --with-pgsql-server-include
    --without-pgsql-server-include=${pgsql-server-dir}/include
    --with-pgsql-server-lib
    --without-pgsql-server-lib=${pgsql-server-dir}/
    --with-pgsql-client-dir
    --without-pgsql-client-dir
    --with-pgsql-client-include
    --without-pgsql-client-include=${pgsql-client-dir}/include
    --with-pgsql-client-lib
    --without-pgsql-client-lib=${pgsql-client-dir}/
    --with-pqlib
    --without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/do_postgres-0.10.14 for         inspection.
Results logged to /Library/Ruby/Gems/2.0.0/extensions/universal-darwin-13/2.0.0/do_postgres-0.10.14/gem_make.out
An error occurred while installing do_postgres (0.10.14), and Bundler cannot continue.
Make sure that `gem install do_postgres -v '0.10.14'` succeeds before bundling.        

我的Gemfile包含:

source 'https://rubygems.org'
ruby '2.0.0'

gem "sinatra"
gem "sinatra-contrib"
gem "sinatra-flash"
gem "thin"
gem 'data_mapper'
gem 'omniauth'
gem 'omniauth-google-oauth2'
gem 'omniauth-github'
gem 'sass'

group :development do
  gem 'dm-sqlite-adapter'
  gem 'do_sqlite3'
end

group :production do
  gem 'pg'
  gem 'dm-postgres-adapter' 
end

我已经尝试手动安装postgres并将其安装在我的计算机上,但它仍然失败。我正在运行Mac OSX Mavericks

1 个答案:

答案 0 :(得分:1)