gpt4 book ai didi

ruby - 无法在 macos-10.15.6 上 bundle 安装 puma 4.3.5 或 gem puma 与 ruby​​-2.6.6

转载 作者:行者123 更新时间:2023-12-03 07:30:33 26 4
gpt4 key购买 nike

这个问题在这里已经有了答案:





puma gem - Failed to build gem native extension

(13 个回答)


去年关闭。




无法在 macos-10.15.6 上 bundle 安装 puma 4.3.5 或 gem puma 与 ruby​​-2.6.6
尝试为我的项目 bundle 依赖项,但 puma 4.3.5 出现错误。
有人知道这个吗?
xxxxxxxxxxxx
这是错误内容:

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

最佳答案

似乎最新版本的 XCode 工具(12 Beta 3)安装了一个 Clang 版本(MacOS 上默认使用的 C 编译器),该版本会在 Puma 的 native 扩展代码上使用的隐式函数上引发错误。
所指出的解决方法 here是告诉 Clang 不要将此行为视为错误。
尝试运行:

bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
bundle install
它应该工作。

关于ruby - 无法在 macos-10.15.6 上 bundle 安装 puma 4.3.5 或 gem puma 与 ruby​​-2.6.6,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63187613/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com