windows系统下安装jekyll报错:Error installing jekyll

Futurefinger
  • 985
 gem install jekyll
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
C:/Ruby22/bin/ruby.exe -r ./siteconf20180227-30372-ssgv65.rb extconf.rb
creating Makefile

current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR=" clean

current directory: C:/Ruby22/lib/ruby/gems/2.2.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
make "DESTDIR="
generating ruby_http_parser-i386-mingw32.def
compiling ruby_http_parser.c
In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
                 from ruby_http_parser.c:1:
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:111:14: error: size of array 'ruby_check_sizeof_voidp' is negative
In file included from c:/Ruby22/include/ruby-2.2.0/ruby.h:33:0,
                 from ruby_http_parser.c:1:
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_freeze_inline':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1156:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1157:2: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1158:27: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_data_object_get':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1192:13: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_obj_written':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:10: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1271:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_num2char_inline':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1344:36: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1345:9: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_class_of':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1670:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h: In function 'rb_type':
c:/Ruby22/include/ruby-2.2.0/ruby/ruby.h:1687:12: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ruby_http_parser.c: In function 'on_message_begin':
ruby_http_parser.c:108:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
ruby_http_parser.c: In function 'on_header_value':
ruby_http_parser.c:146:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
ruby_http_parser.c: In function 'on_headers_complete':
ruby_http_parser.c:192:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
ruby_http_parser.c: In function 'on_body':
ruby_http_parser.c:213:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
ruby_http_parser.c: In function 'on_message_complete':
ruby_http_parser.c:232:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
ruby_http_parser.c: In function 'Parser_execute':
ruby_http_parser.c:314:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ruby_http_parser.c:314:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ruby_http_parser.c:314:15: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ruby_http_parser.c:314:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
ruby_http_parser.c:315:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ruby_http_parser.c:315:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ruby_http_parser.c:315:14: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ruby_http_parser.c:320:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
ruby_http_parser.c:330:7: warning: unknown conversion type character 'z' in format [-Wformat]
ruby_http_parser.c:330:7: warning: unknown conversion type character 'z' in format [-Wformat]
ruby_http_parser.c:330:7: warning: too many arguments for format [-Wformat-extra-args]
ruby_http_parser.c: In function 'Parser_set_header_value_type':
ruby_http_parser.c:451:3: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement]
make: *** [ruby_http_parser.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby22/lib/ruby/gems/2.2.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to C:/Ruby22/lib/ruby/gems/2.2.0/extensions/x86-mingw32/2.2.0/http_parser.rb-0.6.0/gem_make.out
参考安装步骤:http://blog.csdn.net/rainlovi...

本机环境配置信息如下:

clipboard.png

clipboard.png

clipboard.png

回复
阅读 3.2k
1 个回答

亲,我的解决了,结合我的不断重复的过程,问题出在了MYSYS2和bundle这两个身上,我跟你大致说一下我的安装过程及一些注意点(最重要的点就是所有安装目录最好不好出现空格):
1、安装ruby,根据你的教程,无脑点就行,但是有个注意点,安装的路径中,连同命名,不要出现空格!!!
2、ruby安装完,会出现有个选项,让你安装MSYS2这个东东,如果没有勾选,后面自己打开cmd,输入“ridk install”进行MSYS2的安装,会出现然你选择123,你选3就行。这个过程会下载很多安装包什么的,耐心等待,一定要耐心,要完整装完才行,装好会让你再做一次123选择,这个时候不需要选了,直接enter退出就行了。
3、安装DevKit,在官网下载DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe,然后点击运行,同样,安装目录不要出现空格,可以百度这个相关的安装,还是比较简单的
4、然后安装RubyGems,从官网下载压缩包,解压到你想要的目录下,路径不要有空格,然后cmd命令指到这个文件夹下面,输入“ruby setup.rb”执行安装,同样也可百度
5、安装bundler,输入“gem install bundler”执行安装
6、上面的安装基本缺一不可,然后就可以安装jekyll了,执行“gem install jekyll”,最后成功了。

我也是在重复安装卸载安装的过程中,最后成功了,jekyll的要求比较高,所以该有的环境都不能漏,这是我的做法,给你参照下,一次不行就多次,有一点遗漏最好就重新整个过程,不然补这个补那个的最后很容易面目全非,做了无用功。。

你知道吗?

宣传栏