2011-12-29 111 views
3

我在嘗試更新Windows版本的bluecloth gem時收到錯誤消息。是否有需要爲Windows安裝的另一個版本,或者我可以使用的另一種藍色布料?不幸的是,由於我使用的其他軟件,我的開發環境嚴格爲Windows,否則我會使用Linux環境。無法在Windows上安裝或更新Ruby bluecloth gem Ruby 1.9.2

這裏是什麼,我得到了拷貝粘貼:

C:\Users\Developer1>gem update
Updating installed gems
Updating bluecloth
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing bluecloth:
ERROR: Failed to build gem native extension.

C:/Ruby192/bin/ruby.exe extconf.rb
checking for srand()... yes
checking for random()... no
checking for rand()... yes
checking for bzero() in string.h,strings.h... no
checking for strcasecmp()... yes
checking for strncasecmp()... yes
checking for mkdio.h... yes
checking for ruby/encoding.h... yes
creating extconf.h
creating Makefile

make C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_bluecloth_ext'" > bluecloth_ext-i386-mingw32.def gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -DVERSION=\"2.0.9\" -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -I. -o bluecloth.o -c bluecloth.c
In file included from c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../..
/../include/windows.h:48:0,
from c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../..
/../include/winsock2.h:22,
from c:/Ruby192/include/ruby-1.9.1/ruby/win32.h:33,
from c:/Ruby192/include/ruby-1.9.1/ruby/defines.h:205,
from c:/Ruby192/include/ruby-1.9.1/ruby/ruby.h:74,
from c:/Ruby192/include/ruby-1.9.1/ruby.h:32,
from bluecloth.h:14,
from bluecloth.c:25:
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
29:23: error: duplicate 'unsigned'
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
38:23: error: duplicate 'unsigned'
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
38:23: error: two or more data types in declaration specifiers
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
41:24: error: duplicate 'unsigned'
make: * [bluecloth.o] Error 1

Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0 for inspection. Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0/ext/gem_make.out Nothing to update

+0

有您以前安裝了寶石'寶石安裝bluecloth'? – Ramy 2011-12-30 06:25:20

回答

3

2.2.0中的頭文件可以防止在Windows上編譯bluecloth。但是,您可以自行修補它。正如路易斯拉維納所說,你需要應用這條道路。

  1. 運行gem install bluecloth -v '2.2.0'如果您尚未

  2. bluecloth.h文件應用this patch,我的機器上它位於

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h

  3. 轉到bluecloth 2.2.0目錄,例如

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0

  4. 運行rake gem(這可能需要安裝一些額外的寶石)。

    那麼你應該看到創建.gem文件中

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem

  5. 打開此目錄並安裝補丁過的寶石:

    gem install bluecloth-2.2.0.gem --platform=ruby

+1

感謝您提供的信息,但只是從它自己的目錄中徹底清除了寶石。你沒有說先把它複製出來。 – 2013-09-05 13:57:46

+0

我應用了這個補丁,但是我得到了我想要解決的相同錯誤。但不同於這個話題,我的支票沒有找到一些要求。檢查srand()...否 檢查srandom()...否 檢查隨機()...否 檢查rand()...否 檢查string.h中的bzero() strings.h ...否 檢查strcasecmp()...否 檢查stricmp()...否 此擴展需要strcasecmp()或stricmp()我應該重新安裝devkit並重試嗎? – 2013-09-05 14:25:03