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

klsxnrf1  于 2023-10-18  发布在  Ruby
关注(0)|答案(1)|浏览(133)

每次我去跑bundle install
我一直在安装彪马卡住,我曾试图手动安装它使用
gem install puma -v '5.6.4' -- --with-ldflags=-L/usr/local/opt/ [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) /lib --with-cppflags=-I/usr/local/opt/ [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) /include --with-cflags="-Wno-error=implicit-function-declaration"
但毫无用处,我得到了
gem install puma -v '4.3.0' -- --with-ldflags=-L/usr/local/opt/ [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) /lib --with-cppflags=-I/usr/local/opt/ [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) /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中运行我的终端。
我尝试使用gem install puma -v '4.3.0' -- --with-ldflags=-L/usr/local/opt/ [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) /lib --with-cppflags=-I/usr/local/opt/ [[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection) /include --with-cflags="-Wno-error=implicit-function-declaration"从头开始重新安装Puma
我已经完全卸载了自制软件,并在Rosetta下重新安装了它,因为这是建议在工作中完成的,但仍然无济于事。

h9a6wy2h

h9a6wy2h1#

我能够通过交换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

相关问题