ruby - 使用 Homebrew 程序安装 msgpack (0.5.8) mac OSX 错误

标签 ruby macos homebrew msgpack

我一直在尝试使用 homebrew 安装 msgpack,但它反复抛出以下错误:

Building native extensions.  This could take a while...
ERROR:  Error installing msgpack:
ERROR: Failed to build gem native extension.

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/msgpack 
0.5.8/ext/msgpack
/usr/local/opt/ruby/bin/ruby -r ./siteconf20170801-23901-1ar0ojr.rb extconf.rb
checking for ruby/st.h... yes
checking for st.h... yes
checking for rb_str_replace() in ruby.h... yes
creating Makefile

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/msgpack-
0.5.8/ext/msgpack
make "DESTDIR=" clean

current directory: /usr/local/lib/ruby/gems/2.4.0/gems/msgpack-
0.5.8/ext/msgpack
make "DESTDIR="
compiling buffer.c
compiling buffer_class.c
compiling core_ext.c
core_ext.c:121:22: error: use of undeclared identifier 'rb_cFixnum'
rb_define_method(rb_cFixnum, "to_msgpack", Fixnum_to_msgpack, -1);
                 ^
core_ext.c:122:22: error: use of undeclared identifier 'rb_cBignum'
rb_define_method(rb_cBignum, "to_msgpack", Bignum_to_msgpack, -1);
                 ^
2 errors generated.
make: *** [core_ext.o] Error 1

make failed, exit code 2

Gem files will remain installed in 
/usr/local/lib/ruby/gems/2.4.0/gems/msgpack-0.5.8 for inspection.
Results logged to /usr/local/lib/ruby/gems/2.4.0/extensions/x86_64-darwin-
16/2.4.0/msgpack-0.5.8/gem_make.out

寻找解决方案一直没有结果。我的Ruby版本是2.4.1,但我不确定是否是版本问题。

最佳答案

我在 Github 的 msgpack 存储库中发现了这个问题:
https://github.com/msgpack/msgpack-ruby/issues/120

看来这个问题已在版本 1.0.0 中得到解决。
您真的需要使用 0.5.8 版本吗? gem版本可以更新吗?

关于ruby - 使用 Homebrew 程序安装 msgpack (0.5.8) mac OSX 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45443135/

相关文章:

ios - xcode,在模拟器上启动可以,但无法存档

javascript - 之前的web form录入数据后,如何让web form出现?

ruby-on-rails - ruby rails : Why does calling a partial in my views take an extended time to render?

ubuntu - 在 Ubuntu 14.04 上构建 linuxbrew( Homebrew 软件)独立版本

macos - 应用程序在后台时出现 NSVisualEffectView 图形错误

xcode - fatal error : 'jssy.h' file not found

c - 中止陷阱 6 : when running gdb on Mac OS

ruby - 如何只获取没有命名空间的类名

mysql - Ruby 脚本在 sql 查询完成之前结束

image - 如何使用 ImageMagick 调整图像大小? (苹果系统)