首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Bluecloth v2.0.10与windows 7不起作用

Bluecloth v2.0.10与windows 7不起作用
EN

Stack Overflow用户
提问于 2011-02-08 19:01:42
回答 4查看 2.7K关注 0票数 7

DevkitRuby187,我已经从http://rubyinstaller.org/downloads下载了WIth并按照每个https://github.com/oneclick/rubyinstaller/wiki/Development-Kit的说明进行操作。我还通过烟雾测试确保了devkit的正确安装。

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

代码语言:javascript
复制
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>
EN

回答 4

Stack Overflow用户

发布于 2012-06-15 00:58:57

如果你需要2.2.0 (最新版本),下面是我如何让它工作的:

  1. Install DevKit
  2. Run使用以下命令安装bluecloth:

gem install bluecloth

这将在构建“本地扩展”时失败,但会成功安装gem的源代码。bluecloth

  • patch 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

  • Go到bluecloth的gem安装文件夹。对我来说,这看起来像下面这样:

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

  • Run以下命令:

rake gem

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

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

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

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

票数 13
EN

Stack Overflow用户

发布于 2012-03-01 21:03:22

似乎2.0.10版的BlueCloth有一个bug/问题。您可以尝试使用旧版本,如2.0.7:

代码语言:javascript
复制
gem install bluecloth -v 2.0.7

这似乎起作用了。

也许这也值得检查一下最新版本(2.2.0?)如果没有工作,请反馈给gem作者:

http://deveiate.org/projects/BlueCloth/query

票数 6
EN

Stack Overflow用户

发布于 2015-01-20 15:56:51

这是打了补丁的bluecloth.h代码,为赶时间的人准备的。

代码语言:javascript
复制
#ifndef BLUECLOTH_H
#define BLUECLOTH_H
 
#include "ruby.h"

#if defined(HAVE_RUBY_ENCODING_H) && HAVE_RUBY_ENCODING_H
#	define M17N_SUPPORTED
#	include "ruby/encoding.h"
#endif

#include "config.h"
#include "assert.h"
 
#include "mkdio.h"
 
void mkd_initialize  		_(( void ));
void mkd_with_html5_tags	_(( void ));
 
/* Replace the macro from encoding.h that refers to static 'rb_encoding_list' */
#ifdef ENC_FROM_ENCINDEX
#undef ENC_FROM_ENCINDEX
#define ENC_FROM_ENCINDEX(idx) (rb_enc_from_index(idx))
#endif

#endif

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4932221

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档