无法在Windows上安装do_postgres 0.10.17

时间:2019-11-08 19:09:11

标签: ruby windows postgresql sinatra bundle

运行带有postgresql gem的捆绑软件安装时遇到问题。我一直在寻找答案,但只在Linux下找到,并且我在64位上运行Windows 10 Pro

ERROR:  Error installing do_postgres:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/do_postgres-0.10.17/ext/do_postgres
C:/Ruby26-x64/bin/ruby.exe -I C:/Ruby26-x64/lib/ruby/site_ruby/2.6.0 -r ./siteconf20191108-2528-arvofh.rb extconf.rb
checking for -lpq... yes
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for postgres.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=C:/Ruby26-x64/bin/$(RUBY_BASE_NAME)
        --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-pgsql-win32-dir
        --without-pgsql-win32-dir
        --with-pgsql-win32-include
        --without-pgsql-win32-include=${pgsql-win32-dir}/include
        --with-pgsql-win32-lib
        --without-pgsql-win32-lib=${pgsql-win32-dir}/lib
        --with-pqlib
        --without-pqlib
Could not find PostgreSQL build environment (libraries & headers): Makefile not created

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  C:/Ruby26-x64/lib/ruby/gems/2.6.0/extensions/x64-mingw32/2.6.0/do_postgres-0.10.17/mkmf.log

extconf failed, exit code 1

这是我的gemfile,其中包含Datamapper,Postgres,Sqlite和Sinatra的依赖项。

source 'https://rubygems.org'

gem 'sinatra', '>=1.0'
gem 'sinatra-contrib'
gem 'rake'
gem 'data_mapper'
gem 'pg'
gem 'do_postgres','0.10.17'
gem  'dm-postgres-adapter'
gem 'dm-core'
gem 'dm-sqlite-adapter'
gem 'dm-validations'
gem 'dm-aggregates'
gem 'dm-constraints'
gem 'dm-migrations'
gem 'json', '1.8.6'
gem 'do_sqlite3','0.10.17'
gem 'sinatra-cross_origin'

有人知道是否有一种方法可以解决Windows的这种情况。

0 个答案:

没有答案