2017-08-01 71 views
0

我一直在尝试使用自制安装msgpack安装msgpack(0.5.8),并多次引发以下错误:使用自制的Mac OSX错误

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,但我不确定它是否是版本问题。这是我第一次在Ruby上工作,所以任何帮助和耐心,将不胜感激!

谢谢

回答

0

我发现msgpack库这个问题在Github上:
https://github.com/msgpack/msgpack-ruby/issues/120

貌似这个问题在1.0.0版本得到解决。
你真的需要使用版本0.5.8吗?是否有可能更新宝石版本?

+0

谢谢,我更新了我的gem中的msgpack版本,并且它已正确安装。 – nilesguo

相关问题