我在安装柯肯宝石时遇到了这个错误。有人也有同样的问题吗?我使用的是Ruby2.0.0p 353、Rails 4.0和RVM
ERROR: Error installing cocoon:
ERROR: Failed to build gem native extension.
/home/user/.rvm/rubies/ruby-2.0.0-p353/bin/ruby extconf.rb
checking for st.h... yes
creating Makefile
make
compiling handler.c
compiling gram.c
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 syck.c
compiling rubyext.c
rubyext.c: In function ‘mktime_do’:
rubyext.c:292:19: warning: unused variable ‘offset’ [-Wunused-variable]
rubyext.c: In function ‘rb_syck_load_handler’:
rubyext.c:664:5: warning: implicit declaration of function ‘rb_hash_size’ [-Wimplicit- function-declaration]
rubyext.c: In function ‘rb_syck_err_handler’:
rubyext.c:684:12: warning: format ‘%d’ expects argument of type ‘int’, but argument 5 has type ‘long int’ [-Wformat]
rubyext.c: In function ‘syck_const_find’:
rubyext.c:1047:5: warning: implicit declaration of function ‘rb_ary_size’ [-Wimplicit-function-declaration]
rubyext.c: In function ‘syck_scalar_value_set’:
rubyext.c:1481:27: error: ‘struct RString’ has no member named ‘ptr’
rubyext.c: In function ‘syck_seq_initialize’:
rubyext.c:1509:15: warning: variable ‘node’ set but not used [-Wunused-but-set-variable]
rubyext.c: In function ‘syck_node_type_id_set’:
rubyext.c:1741:25: error: ‘struct RString’ has no member named ‘ptr’
make: *** [rubyext.o] Error 1发布于 2013-12-06 04:46:47
茧宝石正在使用珠宝商,它将Rubinius特有的宝石依赖注入宝石规范。从gem规范创建并预期将安装在MRI上的gem包括这些依赖项。我已经提交了一个拉请求来修复这个茧宝石:https://github.com/nathanvda/cocoon/pull/184
通常,我建议在gem的源代码存储库中提交问题,因为作者可能不会被提醒到此处发布的问题。
发布于 2013-12-06 07:40:07
茧1.2.4有一个破碎的宝石规格,这是固定在1.2.5,并在不久后释放。所以现在就该这么做了。
发布于 2013-12-05 03:29:32
# cd /path/rubysl-yaml-2.0.4
# vi ext/rubysl/syck/rubyext.c变更(RSRING -> RSTRING_PTR)
#define syck_copy_string(val) syck_strndup(RSTRING(val)->ptr, RSTRING_LEN(val))至
#define syck_copy_string(val) syck_strndup(RSTRING_PTR(val)->ptr, RSTRING_LEN(val))和创业板的构建和安装。
# gem build rubysl-yaml.gemspec && gem install rubysl-yaml-2.0.4.gem祝好运
https://stackoverflow.com/questions/20390594
复制相似问题