带有Windows 7的Bluecloth v2.0.10无法正常工作 [英] Bluecloth v2.0.10 with windows 7 not working

查看:109
本文介绍了带有Windows 7的Bluecloth v2.0.10无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Ruby 187中,我从 http://rubyinstaller.org/downloads 下载了devkit. 并按照 https://github.com/oneclick/rubyinstaller/wiki/Development-工具包. 我还确保可以通过以下方式正确安装devkit 烟雾测试.

WIth Ruby 187, I had downloaded devkit from http://rubyinstaller.org/downloads and followed the instruction per https://github.com/oneclick/rubyinstaller/wiki/Development-Kit. I had also ensured that devkit is installed properly by following smoke test.

然后我尝试安装bluecloth(v2.0.10).它失败了 出现以下错误:

I had then tried installing bluecloth (v2.0.10). It had failed with following error:

C:\test\typo>gem install bluecloth --platform=ruby

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:/Ruby187/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... no
creating extconf.h
creating Makefile

make
gcc -I. -I. -Ic:/Ruby187/lib/ruby/1.8/i386-mingw32 -I. -
DRUBY_EXTCONF_H=\"extcon
f.h\"    -DVERSION=\"2.0.4\" -g -O2 -DFD_SETSIZE=256   -I. -Wall  -c
bluecloth.c

In file included from c:\rubydevkit\mingw\bin\../lib/gcc/
mingw32/4.5.1/../../../../include/windows.h:48:0,
                from c:\rubydevkit\mingw\bin\../lib/gcc/
mingw32/4.5.1/../../../../include/winsock2.h:22,
                from c:/Ruby187/lib/ruby/1.8/i386-mingw32/win32/
win32.h:27,
                from c:/Ruby187/lib/ruby/1.8/i386-mingw32/defines.h:
186,
                from c:/Ruby187/lib/ruby/1.8/i386-mingw32/ruby.h:37,
                from bluecloth.h:14,
                from bluecloth.c:25:
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:229:23: error: duplicate 'unsigned'
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: duplicate 'unsigned'
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: two or more data types in declaration
specifiers
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:241:24: error: duplicate 'unsigned'
bluecloth.c: In function 'bluecloth_initialize':
bluecloth.c:190:9: warning: unused variable 'utf8text'
make: *** [bluecloth.o] Error 1

Gem files will remain installed in c:/Ruby187/lib/ruby/gems/1.8/gems/
bluecloth-2.0.10 for inspection.
Results logged to c:/Ruby187/lib/ruby/gems/1.8/gems/bluecloth-2.0.10/
ext/gem_make.out

C:\test\typo>

推荐答案

如果您需要2.2.0(最新版本),请按照以下步骤操作:

If you need 2.2.0 (the latest version), here's how I got it to work:

  1. 安装 DevKit

运行以下命令以安装bluecloth:

Run the command below to install bluecloth:

gem install bluecloth

这在构建本机扩展"时会失败,但是会成功安装gem的源代码.

this will fail miserably when building "native extensions", but will successfully install the gem's source code.

修补 bluecloth.h 文件(对我而言,该文件位于:D:\ ruby​​ \ Ruby-1.9.3-p125 \ lib \ ruby​​ \ gems \ 1.9.1 \ gems \ bluecloth-2.2.0 \ ext),以及来自以下位置的补丁: https://gist.github.com/1539611

Patch bluecloth.h file (for me, this is found in: D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext), with the patch from here: https://gist.github.com/1539611

转到bluecloth的gem安装文件夹.对我来说,如下所示:

Go to bluecloth's gem installation folder. For me, this looks like below:

D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0

运行以下命令:

rake gem

它可能会提示您安装其他一些宝石,请按照相应的步骤进行操作. 完成后,您应该看到创建了bluecloth-2.2.0.gem.对我来说,可以在这里找到:

It may prompt you to install some other gems, follow accordingly. When it's done, you should see a bluecloth-2.2.0.gem created. For me, it is found here:

D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem

转到bluecloth-2.2.0.gem位置,然后运行以下命令:

Go to bluecloth-2.2.0.gem location, and run the following command:

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

这篇关于带有Windows 7的Bluecloth v2.0.10无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆