2012-01-13 43 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