未能在macos-10.15.6上捆绑安装puma 4.3.5或gem puma与ruby-2.6.6

未能在macos-10.15.6上捆绑安装puma 4.3.5或gem puma与ruby-2.6.6,ruby,macos,rubygems,bundler,Ruby,Macos,Rubygems,Bundler,未能在macos-10.15.6上捆绑安装puma 4.3.5或gem puma与ruby-2.6.6 尝试为我的项目绑定依赖项,但puma 4.3.5出现错误。 有人知道这件事吗 XXXXXXXXXX 以下是错误内容: fetching puma 4.3.5 Installing puma 4.3.5 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. cu

未能在macos-10.15.6上捆绑安装puma 4.3.5或gem puma与ruby-2.6.6 尝试为我的项目绑定依赖项,但puma 4.3.5出现错误。 有人知道这件事吗

XXXXXXXXXX

以下是错误内容:

fetching puma 4.3.5
Installing puma 4.3.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
/Users/lxj/.rvm/rubies/ruby-2.6.6/bin/ruby -I /Users/lxj/.rvm/rubies/ruby-2.6.6/lib/ruby/site_ruby/2.6.0 -r ./siteconf20200731-28585-1eobsvu.rb extconf.rb
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... yes
checking for TLS_server_method() in openssl/ssl.h... yes
checking for SSL_CTX_set_min_proto_version in openssl/ssl.h... yes
creating Makefile

current directory: /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
make "DESTDIR=" clean

current directory: /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/puma_http11/http11_parser.c:44:18: warning: unused variable 'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
                 ^
1 warning generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:145:7: warning: unused variable 'min' [-Wunused-variable]
  int min, ssl_options;
      ^
mini_ssl.c:299:40: warning: function 'raise_error' could be declared with attribute 'noreturn' [-Wmissing-noreturn]
void raise_error(SSL* ssl, int result) {
                                       ^
2 warnings generated.
compiling puma_http11.c
puma_http11.c:203:22: error: implicitly declaring library function 'isspace' with type 'int (int)' [-Werror,-Wimplicit-function-declaration]
  while (vlen > 0 && isspace(value[vlen - 1])) vlen--;
                     ^
puma_http11.c:203:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
1 error generated.
make: *** [puma_http11.o] Error 1

make failed, exit code 2

Gem files will remain installed in /Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5 for inspection.
Results logged to /Users/lxj/.rvm/gems/ruby-2.6.6/extensions/x86_64-darwin-19/2.6.0/puma-4.3.5/gem_make.out

An error occurred while installing puma (4.3.5), and Bundler cannot continue.
Make sure that `gem install puma -v '4.3.5'` succeeds before bundling.

In Gemfile:
  puma
fetching puma 4.3.5
使用本机扩展安装puma 4.3.5
Gem::Ext::BuildError:错误:无法生成Gem本机扩展。
当前目录:/Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
/Users/lxj/.rvm/rubies/ruby-2.6.6/bin/ruby-I/Users/lxj/.rvm/rubies/ruby-2.6.6/lib/ruby/site\u ruby/2.6.0-r./siteconf20200731-28585-1eobsvu.rb extconf.rb
正在-lcrypto中检查BIO_read()。。。对
正在-lssl中检查SSL_CTX_new()。。。对
正在检查openssl/bio.h。。。对
正在检查openssl/ssl.h中的DTLS_方法()。。。对
正在检查openssl/ssl.h中的TLS_服务器_方法()。。。对
正在检查openssl/SSL.h中的SSL\u CTX\u set\u min\u proto\u版本。。。对
创建Makefile
当前目录:/Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
使“DESTDIR=”干净
当前目录:/Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5/ext/puma_http11
使“DESTDIR=”
编译http11_parser.c
ext/puma_http11/http11_parser.c:44:18:警告:未使用的变量“puma_parser_en_main”[-Wunused const variable]
静态常量int puma_parser_en_main=1;
^
生成1个警告。
编译io_buffer.c
编译mini_ssl.c
mini_ssl.c:145:7:警告:未使用的变量“min”[-Wunused variable]
int min,ssl_选项;
^
mini_ssl.c:299:40:警告:函数“raise_error”可以用属性“noreturn”[-Wmissing noreturn]声明
无效raise_错误(SSL*SSL,int结果){
^
生成2个警告。
编译puma_http11.c
puma_http11.c:203:22:错误:隐式声明类型为“int(int)”的库函数“isspace”[-Werror,-Wimplicit函数声明]
而(vlen>0&&isspace(值[vlen-1])vlen--;
^
puma_http11.c:203:22:注意:包括标题或显式提供“isspace”声明
生成1个错误。
制造商:**[puma_http11.o]错误1
make失败,退出代码2
Gem文件仍将安装在/Users/lxj/.rvm/gems/ruby-2.6.6/gems/puma-4.3.5中以供检查。
结果记录到/Users/lxj/.rvm/gems/ruby-2.6.6/extensions/x86_64-darwin-19/2.6.0/puma-4.3.5/gem_make.out
安装puma(4.3.5)时出错,Bundler无法继续。
在绑定之前,请确保'gem install puma-v'4.3.5'成功。
在文件中:
彪马

最新版本的XCode tools(12 Beta 3)似乎安装了Clang(MacOS上默认使用的C编译器)版本,该版本在Puma本机扩展代码上使用的隐式函数上抛出错误

所指出的解决方法是告诉Clang不要将此行为视为错误

尝试运行:

bundle config build.puma--with cflags=“-Wno error=隐式函数声明”
捆绑安装

它应该可以工作。

但是安装puma 4.0.1没问题。您是否确保
gem install puma-v'4.3.5'
成功?我认为问题的答案是错误的:链接的答案解决了
openssl
相关问题,但正如您所看到的,发布的错误与openssl无关。我可以确认@RickLuo被我提出的答案解决了。谢谢你!这真的很有帮助!拯救我的一天实际上是另一块宝石(薄)发生了这个错误,它也成功了!很高兴听到这个消息!如果它解决了您的问题,请不要忘记将这个答案标记为已接受。这对我也起到了作用。如果像这样的错误可能会提示您需要在
bundle install
failsupgrade puma to 4.3.6修复此问题时将该行添加到bundle config中,那就太棒了