开发者

install do_postgres with bundle

开发者 https://www.devze.com 2023-03-05 15:51 出处:网络
I have created a Gemfile in my rack application (that previously used .gems). When I run \"bundle\" I have the following error linked to \"do_postgres\". I do remember having installed postgres on my

I have created a Gemfile in my rack application (that previously used .gems). When I run "bundle" I have the following error linked to "do_postgres". I do remember having installed postgres on my machine (mac OS) in the past but it seems the libraries cannot be find. Any ideas ?

...
Using dm-core (1.1.0) 
Using dm-do-adapter (1.1.0) 
Using dm-migrations (1.1.0) 
Installing do_postgres (0.10.5) with native extensions /Library/Ruby/Site/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb 
extconf.rb:3: command not found: pg_config --includedir-server
extconf.rb:13: command not found: pg_config --libdir
extconf.rb:13: command not found: pg_config --includedir
extconf.rb:13: command not found: pg_config --libdir
checking for main() in -lpq... no
checking for main() in -llibpq... 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/1.8/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}/lib
    --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}/lib
    --with-pqlib
    --without-pqlib
    --with-libpqlib
    --without-libpqlib
Could not find PostgreSQL开发者_高级运维 build environment (libraries & headers): Makefile not created

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/do_postgres-0.10.5 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/do_postgres0.10.5/ext/do_postgres/gem_make.out
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `each'
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:446:in `build_extensions'
    from /Library/Ruby/Site/1.8/rubygems/installer.rb:198:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/source.rb:96:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:55:in `run'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/spec_set.rb:12:in `each'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:44:in `run'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/installer.rb:8:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/cli.rb:226:in `install'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `send'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/bin/bundle:13
    from /usr/bin/bundle:19:in `load'
    from /usr/bin/bundle:19


Fresh install of postgres with brew fixed the thing: http://russbrooks.com/2010/11/25/install-postgresql-9-on-os-x


sudo apt-get install postgresql-9.3 postgresql-server-dev-9.3 libpq-dev

Fixed for me.

0

精彩评论

暂无评论...
验证码 换一张
取 消