安装 msgpack gem 时收到此错误:
/Users/orbanbotond/.frum/versions/3.0.4/lib/ruby/gems/3.0.0/gems/msgpack-1.4.4/ext/msgpack
make DESTDIR\=
compiling buffer.c
compiling buffer_class.c
buffer_class.c:261:17: error: incompatible function pointer types passing 'VALUE (VALUE)' (aka
'unsigned long (unsigned long)') to parameter of type 'VALUE (*)(VALUE, VALUE)' (aka 'unsigned long
(*)(unsigned long, unsigned long)') [-Wincompatible-function-pointer-types]
read_until_eof_error, (VALUE)(void*) args,
^~~~~~~~~~~~~~~~~~~~
/Users/orbanbotond/.frum/versions/3.0.4/include/ruby-3.0.0/ruby/internal/iterator.h:51:47: note:
passing argument to parameter here
VALUE rb_rescue2(VALUE(*)(VALUE),VALUE,VALUE(*)(VALUE,VALUE),VALUE,...);
^
1 error generated.
make: *** [buffer_class.o] Error 1
make failed, exit code 2
我在 mac M2 上设置时遇到类似问题,通过添加选项修复:
gem install msgpack -v '1.4.2' -- --with-cflags=-Wno-error=incompatible-function-pointer-types
所以我认为你可以尝试使用相同的版本,将上述命令的版本替换为
1.4.4