2011-12-29 142 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