2012-01-13 57 views
5

我想在Windows上爲Ruby on Rails 3.1安裝Publify Web博客CMS 6.0.9。使用軟件包安裝來安裝Publify,藍色寶石上的錯誤

每次我試圖bundle installPublify,我安裝bluecloth寶石時,你得到同樣的錯誤信息:

C:\Users\Lunasea\Downloads\typo-6.0.9>gem install 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:/RailsInstaller/Ruby1.9.2/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:/RailsInstaller/Ruby1.9.2/bin/ruby -e "puts 'EXPORTS', 'Init_bluecloth_ext'" 
> bluecloth_ext-i386-mingw32.def 
gcc -I. -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/i386-mingw32 -I/C/Rails 
Installer/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/RailsInstaller/Ruby1.9 
.2/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-st 
rings -Wno-missing-field-initializers -Wno-long-long -I. -o bluecloth.o -c blue 
cloth.c 
In file included from c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5. 
1/../../../../include/windows.h:48:0, 
       from c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5. 
1/../../../../include/winsock2.h:22, 
       from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/win32. 
h:33, 
       from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/define 
s.h:205, 
       from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/ruby.h 
:74, 
       from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby.h:32, 
       from bluecloth.h:14, 
       from bluecloth.c:25: 
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/ 
windef.h:229:23: error: duplicate 'unsigned' 
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/ 
windef.h:238:23: error: duplicate 'unsigned' 
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/ 
windef.h:238:23: error: two or more data types in declaration specifiers 
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/ 
windef.h:241:24: error: duplicate 'unsigned' 
make: *** [bluecloth.o] Error 1 


Gem files will remain installed in C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9 
.1/gems/bluecloth-2.2.0 for inspection. 
Results logged to C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bluecloth 
-2.2.0/ext/gem_make.out 

我已經嘗試過獨自或只需安裝寶石安裝最新版本,但它給總是一樣的結果。

我正在使用標準生成的database.yml。

回答

2

Windows並不是運行rails的最大環境。這是一個很好的例子。有關更多信息,請參見this link

+0

感謝您的快速答覆!你能幫我安裝patch plz嗎?我從來沒有這樣做過......關於環境我知道Windows並不是最好的,但是我沒有Mac,我也不喜歡在我的Linux VMWare上編程。 – 2012-01-13 09:20:52

+0

我通過刪除「紅色」線並在您提供的鏈接中添加「綠色」線來測試修補程序,但它不起作用...:S – 2012-01-13 09:47:24

5

2.2.0中的頭文件可以防止在窗口上編譯bluecloth。但是,你可以自己打補丁:

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

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

    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

+0

修補程序解決了ruby 1.9.3 mingw/Windows 7上的問題。 – nre 2013-03-09 14:52:51

+0

對於像我這樣的ppl面臨的錯誤: 在步驟4之後,將pkg目錄的內容移至臨時目錄,轉至臨時目錄,然後在步驟5中執行命令 – TheAshwaniK 2014-03-05 22:25:59

+0

第4步拋出錯誤 - rake中止! - 將其作爲單獨的問題在這裏 - http://stackoverflow.com/questions/24327130/ruby-error-with-installing-bluecloth-2-2-0-gem-in-win-7-ruby-1-9-3 – user3206440 2014-06-20 12:21:09