鍍金池/ 問答/Ruby  Linux  網(wǎng)絡(luò)安全/ windows系統(tǒng)下安裝jekyll報(bào)錯(cuò):Error installing je

windows系統(tǒng)下安裝jekyll報(bào)錯(cuò):Error installing jekyll

 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...

本機(jī)環(huán)境配置信息如下:

clipboard.png

clipboard.png

clipboard.png

回答
編輯回答
浪婳

親,我的解決了,結(jié)合我的不斷重復(fù)的過程,問題出在了MYSYS2和bundle這兩個(gè)身上,我跟你大致說一下我的安裝過程及一些注意點(diǎn)(最重要的點(diǎn)就是所有安裝目錄最好不好出現(xiàn)空格):
1、安裝ruby,根據(jù)你的教程,無腦點(diǎn)就行,但是有個(gè)注意點(diǎn),安裝的路徑中,連同命名,不要出現(xiàn)空格!??!
2、ruby安裝完,會(huì)出現(xiàn)有個(gè)選項(xiàng),讓你安裝MSYS2這個(gè)東東,如果沒有勾選,后面自己打開cmd,輸入“ridk install”進(jìn)行MSYS2的安裝,會(huì)出現(xiàn)然你選擇123,你選3就行。這個(gè)過程會(huì)下載很多安裝包什么的,耐心等待,一定要耐心,要完整裝完才行,裝好會(huì)讓你再做一次123選擇,這個(gè)時(shí)候不需要選了,直接enter退出就行了。
3、安裝DevKit,在官網(wǎng)下載DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe,然后點(diǎn)擊運(yùn)行,同樣,安裝目錄不要出現(xiàn)空格,可以百度這個(gè)相關(guān)的安裝,還是比較簡(jiǎn)單的
4、然后安裝RubyGems,從官網(wǎng)下載壓縮包,解壓到你想要的目錄下,路徑不要有空格,然后cmd命令指到這個(gè)文件夾下面,輸入“ruby setup.rb”執(zhí)行安裝,同樣也可百度
5、安裝bundler,輸入“gem install bundler”執(zhí)行安裝
6、上面的安裝基本缺一不可,然后就可以安裝jekyll了,執(zhí)行“gem install jekyll”,最后成功了。

我也是在重復(fù)安裝卸載安裝的過程中,最后成功了,jekyll的要求比較高,所以該有的環(huán)境都不能漏,這是我的做法,給你參照下,一次不行就多次,有一點(diǎn)遺漏最好就重新整個(gè)過程,不然補(bǔ)這個(gè)補(bǔ)那個(gè)的最后很容易面目全非,做了無用功。。

2018年1月9日 15:50