gem install syck -v'1.0.1'无效

时间:2015-09-23 09:33:47

标签: ruby-on-rails ruby linux

我试过运行此代码

gem install syck -v '1.0.1'

它显示如下错误

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

    /home/sherin/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20150923-19918-9w2wjv.rb extconf.rb checking for st.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR=" compiling token.c token.re: In function
‘sycklex_yaml_utf8’: token.re:541:36: warning: variable ‘lvl’ set but
not used [-Wunused-but-set-variable] compiling implicit.c compiling
syck.c compiling gram.c compiling bytecode.c compiling node.c
compiling rubyext.c rubyext.c:31:20: error: field ‘hash’ has
incomplete type
     struct RHash   hash;
                    ^ rubyext.c: In function ‘syck_seq_initialize’: rubyext.c:1529:15: warning: variable ‘node’ set but not used
[-Wunused-but-set-variable]
     SyckNode *node;
               ^ make: *** [rubyext.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/home/sherin/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/syck-1.0.1
for inspection. Results logged to
/home/sherin/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-linux/2.2.0-static/syck-1.0.1/gem_make.out

为什么会这样?..

1 个答案:

答案 0 :(得分:0)

您可以尝试使用ruby 2.1,因为2.2似乎会导致这个特定版本的syck出现问题。

如果你想保留ruby 2.2,你可能不得不使用更新版本的syck。

另见: How to install syck 1.0.1 on Ubuntu 15.04?