gpt4 book ai didi

ruby-on-rails - 无法在 macos Catalina 上安装 ffi -v '1.9.18'

转载 作者:行者123 更新时间:2023-12-04 04:27:23 25 4
gpt4 key购买 nike

无法安装特定的 ffi 版本。如果我运行 gem install ffi,一切正常,但我需要特定版本 1.9.18 并且它不起作用。

Fetching ffi 1.9.18
Installing ffi 1.9.18 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-
1.9.18/ext/ffi_c
/Users/chille/.rbenv/versions/2.6.5/bin/ruby -I
/Users/chille/.rbenv/versions/2.6.5/lib/ruby/2.6.0 -r
./siteconf20200928-22154-72wopi.rb extconf.rb
checking for ffi_call() in -lffi... yes
checking for ffi_prep_closure()... yes
checking for ffi_raw_call()... yes
checking for ffi_prep_raw_closure()... yes
checking for shlwapi.h... no
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_with_gvl()... yes
checking for rb_thread_call_without_gvl()... yes
checking for ffi_prep_cif_var()... yes
creating extconf.h
creating Makefile

current directory: /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-
1.9.18/ext/ffi_c
make "DESTDIR=" clean

current directory: /Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-
1.9.18/ext/ffi_c
make "DESTDIR="
compiling AbstractMemory.c
compiling ArrayType.c
compiling Buffer.c
compiling Call.c
Call.c:355:5: error: implicit declaration of function 'rb_thread_call_without_gvl' is
invalid in C99
[-Werror,-Wimplicit-function-declaration]
rbffi_thread_blocking_region(call_blocking_function, data, (void *) -1, NULL);
^
./Thread.h:78:39: note: expanded from macro 'rbffi_thread_blocking_region'
# define rbffi_thread_blocking_region rb_thread_call_without_gvl
^
1 error generated.
make: *** [Call.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/ffi-1.9.18 用于检查。
结果记录到/Users/chille/.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/extensions/x86_64-
darwin-19/2.6.0/ffi-1.9.18/gem_make.out
安装 ffi (1.9.18) 时出错,Bundler 无法继续。
确保 gem install ffi -v '1.9.18'在捆绑之前成功。
在 Gemfile 中:
bootstrap-sass 被解析为 3.3.7,这取决于
sass 被解析为 3.5.5,这取决于
sass-listen 被解析为 4.0.0,这取决于
rb-inotify 被解析为 0.9.10,这取决于
菲菲

最佳答案

要克服该错误,请使用以下命令安装 ffi:gem install ffi -v '1.9.18' -- --with-cflags="-Wno-error=implicit-function-declaration"

关于ruby-on-rails - 无法在 macos Catalina 上安装 ffi -v '1.9.18',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64098041/

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