为什么这些红宝石宝石不会编译?(Why won't these ruby gems compile?)
我尝试安装几个版本的jekyll,但奇怪的是它们编译失败。 第一颗宝石是jekyll 1.5.1所要求的。 这是它的错误:
$ gem install fast-stemmer Building native extensions. This could take a while... ERROR: Error installing fast-stemmer: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb creating Makefile make compiling porter.c porter.c: In function ‘step5’: porter.c:359:7: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] compiling porter_wrap.c porter_wrap.c: In function ‘stem_word’: porter_wrap.c:20:17: warning: unused variable ‘i’ [-Wunused-variable] linking shared-object stemmer.so make install /usr/bin/install -c -m 0755 stemmer.so /home/user/.gem/gems/fast-stemmer-1.0.2/lib installing default stemmer libraries Gem files will remain installed in /home/user/.gem/gems/fast-stemmer-1.0.2 for inspection. Results logged to /home/user/.gem/gems/fast-stemmer-1.0.2/ext/gem_make.out尝试安装最新版本的jekyll也会失败:
$ gem install jekyll Fetching: liquid-2.6.3.gem (100%) Fetching: kramdown-1.8.0.gem (100%) Fetching: mercenary-0.3.5.gem (100%) Fetching: safe_yaml-1.0.4.gem (100%) Fetching: colorator-0.1.gem (100%) Fetching: yajl-ruby-1.2.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb creating Makefile make compiling yajl.c compiling yajl_alloc.c compiling yajl_buf.c compiling yajl_encode.c compiling yajl_ext.c yajl_ext.c: In function ‘rb_yajl_parser_parse’: yajl_ext.c:471:17: warning: variable ‘stat’ set but not used [-Wunused-but-set-variable] compiling yajl_gen.c compiling yajl_lex.c compiling yajl_parser.c compiling yajl_version.c linking shared-object yajl/yajl.so make install /usr/bin/install -c -m 0755 yajl.so /home/user/.gem/gems/yajl-ruby-1.2.1/lib/yajl installing default yajl libraries Gem files will remain installed in /home/user/.gem/gems/yajl-ruby-1.2.1 for inspection. Results logged to /home/user/.gem/gems/yajl-ruby-1.2.1/ext/yajl/gem_make.outI tried installing a couple versions of jekyll, but they strangely fail compilation. The first gem is required by jekyll 1.5.1. Here are its errors:
$ gem install fast-stemmer Building native extensions. This could take a while... ERROR: Error installing fast-stemmer: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb creating Makefile make compiling porter.c porter.c: In function ‘step5’: porter.c:359:7: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses] compiling porter_wrap.c porter_wrap.c: In function ‘stem_word’: porter_wrap.c:20:17: warning: unused variable ‘i’ [-Wunused-variable] linking shared-object stemmer.so make install /usr/bin/install -c -m 0755 stemmer.so /home/user/.gem/gems/fast-stemmer-1.0.2/lib installing default stemmer libraries Gem files will remain installed in /home/user/.gem/gems/fast-stemmer-1.0.2 for inspection. Results logged to /home/user/.gem/gems/fast-stemmer-1.0.2/ext/gem_make.outAttempts to install the most recent version of jekyll also fail:
$ gem install jekyll Fetching: liquid-2.6.3.gem (100%) Fetching: kramdown-1.8.0.gem (100%) Fetching: mercenary-0.3.5.gem (100%) Fetching: safe_yaml-1.0.4.gem (100%) Fetching: colorator-0.1.gem (100%) Fetching: yajl-ruby-1.2.1.gem (100%) Building native extensions. This could take a while... ERROR: Error installing jekyll: ERROR: Failed to build gem native extension. /usr/bin/ruby1.9.1 extconf.rb creating Makefile make compiling yajl.c compiling yajl_alloc.c compiling yajl_buf.c compiling yajl_encode.c compiling yajl_ext.c yajl_ext.c: In function ‘rb_yajl_parser_parse’: yajl_ext.c:471:17: warning: variable ‘stat’ set but not used [-Wunused-but-set-variable] compiling yajl_gen.c compiling yajl_lex.c compiling yajl_parser.c compiling yajl_version.c linking shared-object yajl/yajl.so make install /usr/bin/install -c -m 0755 yajl.so /home/user/.gem/gems/yajl-ruby-1.2.1/lib/yajl installing default yajl libraries Gem files will remain installed in /home/user/.gem/gems/yajl-ruby-1.2.1 for inspection. Results logged to /home/user/.gem/gems/yajl-ruby-1.2.1/ext/yajl/gem_make.out最满意答案
问题是由于脚本在编译步骤中选择了-Werror 。 使用DEBUG=false对gem命令进行前缀允许编译成功:
DEBUG=false gem install jekyll -v 1.5.1 --no-ri --no-rdocThe problem is due to scripts selecting -Werror during the compilation step. Prefixing the gem command with DEBUG=false allowed the compilation to succeed:
DEBUG=false gem install jekyll -v 1.5.1 --no-ri --no-rdoc更多推荐
发布评论