尝试运行捆绑安装时,我不断收到错误安装 puma (5.6.4) 时发生错误,并且 Bundler 无法继续 MacOS 13.1

问题描述 投票:0回答:1

每次去跑步

bundle install

我一直卡在安装 puma 上,我尝试使用手动安装它

gem install puma -v '5.6.4' -- --with-ldflags=-L/usr/local/opt/[email protected]/lib --with-cppflags=-I/usr/local/opt/[email protected]/include --with-cflags="-Wno-error=implicit-function-declaration"

无济于事,我确实得到了

gem install puma -v '4.3.0' -- --with-ldflags=-L/usr/local/opt/[email protected]/lib --with-cppflags=-I/usr/local/opt/[email protected]/include --with-cflags="-Wno-error=implicit-function-declaration"

成功工作,但那是我能够运行的唯一美洲狮版本。

以下是捆绑安装的输出

Installing haml-rails 2.1.0 (was 2.0.1)
Installing premailer-rails 1.12.0 (was 1.11.1)
Installing devise_saml_authenticatable 1.9.1 (was 1.9.0)
Installing fog-aws 3.15.0 (was 3.14.0)
Using site_prism 3.7.3
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4/ext/puma_http11
/Users/user/.rvm/rubies/ruby-2.7.5/bin/ruby -I /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0 -r ./siteconf20230113-31731-rzw4du.rb extconf.rb
--with-cflags\=-Wno-error\=implicit-function-declaration
checking for BIO_read() in -llibcrypto... no
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
checking for DTLS_method() in openssl/ssl.h... no
checking for SSL_CTX_set_session_cache_mode(NULL, 0) in openssl/ssl.h... yes
checking for TLS_server_method() in openssl/ssl.h... no
checking for SSL_CTX_set_min_proto_version(NULL, 0) in openssl/ssl.h... no
checking for X509_STORE_up_ref()... no
checking for SSL_CTX_set_ecdh_auto(NULL, 0) in openssl/ssl.h... no
checking for SSL_CTX_set_dh_auto(NULL, 0) in openssl/ssl.h... no
checking for SSL_get1_peer_certificate() in openssl/ssl.h... no
checking for Random.bytes... yes
creating Makefile

current directory: /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4/ext/puma_http11
make "DESTDIR=" clean

current directory: /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
compiling mini_ssl.c
mini_ssl.c:301:32: warning: implicit declaration of function 'SSL_CTX_get0_param' is invalid in C99 [-Wimplicit-function-declaration]
    X509_VERIFY_PARAM *param = SSL_CTX_get0_param(ctx);
                               ^
mini_ssl.c:301:24: warning: incompatible integer to pointer conversion initializing 'X509_VERIFY_PARAM *' (aka 'struct X509_VERIFY_PARAM_st *') with an expression of
type 'int' [-Wint-conversion]
    X509_VERIFY_PARAM *param = SSL_CTX_get0_param(ctx);
                       ^       ~~~~~~~~~~~~~~~~~~~~~~~
2 warnings generated.
compiling puma_http11.c
linking shared-object puma/puma_http11.bundle
Undefined symbols for architecture x86_64:
  "_SSL_CTX_get0_param", referenced from:
      _sslctx_initialize in mini_ssl.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [puma_http11.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/user/.rvm/gems/ruby-2.7.5/gems/puma-5.6.4 for inspection.
Results logged to /Users/user/.rvm/gems/ruby-2.7.5/extensions/x86_64-darwin-22/2.7.0/puma-5.6.4/gem_make.out

  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:99:in `run'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:51:in `block in make'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:43:in `each'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:43:in `make'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:63:in `block in build'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/tempfile.rb:291:in `open'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/ext_conf_builder.rb:30:in `build'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:169:in `block in build_extension'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `synchronize'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:165:in `build_extension'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:210:in `block in build_extensions'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `each'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/ext/builder.rb:207:in `build_extensions'
  /Users/user/.rvm/rubies/ruby-2.7.5/lib/ruby/2.7.0/rubygems/installer.rb:844:in `build_extensions'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/rubygems_gem_installer.rb:71:in `build_extensions'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/rubygems_gem_installer.rb:28:in `install'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/source/rubygems.rb:204:in `install'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/gem_installer.rb:54:in `install'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/parallel_installer.rb:186:in `do_install'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/installer/parallel_installer.rb:177:in `block in worker_pool'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:62:in `apply_func'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:57:in `block in process_queue'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:54:in `loop'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:54:in `process_queue'
  /Users/user/.rvm/gems/ruby-2.7.5/gems/bundler-2.3.14/lib/bundler/worker.rb:91:in `block (2 levels) in create_threads'

An error occurred while installing puma (5.6.4), and Bundler cannot continue.

In Gemfile:
  puma
❯ uname -m
x86_64

我使用的是 M1 Pro MacBook Pro,但我在 Rosetta 中运行我的终端。

我尝试使用从头开始重新安装 Puma

gem install puma -v '4.3.0' -- --with-ldflags=-L/usr/local/opt/[email protected]/lib --with-cppflags=-I/usr/local/opt/[email protected]/include --with-cflags="-Wno-error=implicit-function-declaration"

我已经完全卸载自制程序并在 Rosetta 下重新安装它,因为这是建议在工作中完成的操作,但仍然无济于事。

ruby rubygems homebrew puma macos-ventura
1个回答
0
投票

我能够通过交换默认版本的 OpenSSL 在 Intel MacOS 13.5 上安装 puma (5.6.4):

brew unlink openssl@3
brew link [email protected]
bundle install

完成后一定要把它们换回来!

brew unlink [email protected]
brew link openssl@3
© www.soinside.com 2019 - 2024. All rights reserved.