如何在 mac mini m1 上安装 gem pg?

时间:2021-03-23 15:14:56

标签: ruby-on-rails postgresql rubygems pg apple-m1

我在 m1 mac mini 上安装 gem pg 时遇到问题。我试图在 Heroku 和 netlify 上托管。想知道是否有人找到了解决方法。我尝试了几种堆栈溢出的解决方案,但没有任何效果。

请帮忙,我认为自己是这类东西的菜鸟。

下面是我得到的错误。

`

jonathanbleibdrey@Little-Mac listen_to_the_humans % gem install pg
Building native extensions. This could take a while...
ERROR:  Error installing pg:
        ERROR: Failed to build gem native extension.

    current directory: /Users/jonathanbleibdrey/.rvm/gems/ruby-2.6.1/gems/pg-1.2.3/ext
/Users/jonathanbleibdrey/.rvm/rubies/ruby-2.6.1/bin/ruby -I /Users/jonathanbleibdrey/.rvm/rubies/ruby-2.6.1/lib/ruby/site_ruby/2.6.0 -r ./siteconf20210323-28582-1dv0k5o.rb extconf.rb
checking for pg_config... yes
Using config values from /opt/homebrew/bin/pg_config
checking for libpq-fe.h... yes
checking for libpq/libpq-fs.h... yes
checking for pg_config_manual.h... yes
checking for PQconnectdb() in -lpq... no
checking for PQconnectdb() in -llibpq... no
checking for PQconnectdb() in -lms/libpq... no
Can't find the PostgreSQL client library (libpq)
*** 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
        --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/jonathanbleibdrey/.rvm/rubies/ruby-2.6.1/bin/$(RUBY_BASE_NAME)
        --with-pg
        --without-pg
        --enable-windows-cross
        --disable-windows-cross
        --with-pg-config
        --without-pg-config
        --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
        --with-pqlib
        --without-pqlib
        --with-libpqlib
        --without-libpqlib
        --with-ms/libpqlib
        --without-ms/libpqlib

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

  /Users/jonathanbleibdrey/.rvm/gems/ruby-2.6.1/extensions/x86_64-darwin-19/2.6.0/pg-1.2.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/jonathanbleibdrey/.rvm/gems/ruby-2.6.1/gems/pg-1.2.3 for inspection.
Results logged to /Users/jonathanbleibdrey/.rvm/gems/ruby-2.6.1/extensions/x86_64-darwin-19/2.6.0/pg-1.2.3/gem_make.out

`

让我知道我能做什么或我能找到的资源,或者即使我们可以缩放修复它也想在一周内启动它。

1 个答案:

答案 0 :(得分:0)

想通了:我的自制软件中有一些过时的依赖项。我所要做的就是

<块引用>

自制升级

我觉得。