我尝试运行此代码
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
为什么会这样呢?
最佳答案
您可以尝试使用ruby 2.1,因为2.2似乎导致此特定版本的syck出现问题。
如果要保留ruby 2.2,则可能必须使用较新版本的syck。
也可以看看:
How to install syck 1.0.1 on Ubuntu 15.04?
关于ruby-on-rails - gem install syck -v'1.0.1'无法正常工作,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/32735924/