7

Ruby 187 では、 http: //rubyinstaller.org/downloads から devkit をダウンロードし、https://github.com/oneclick/rubyinstaller/wiki/Development-Kit の指示に従いました。また、スモーク テストに従って、devkit が適切にインストールされていることを確認しました。

次に、bluecloth (v2.0.10) をインストールしようとしました。次のエラーで失敗しました:

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>
4

4 に答える 4

13

2.2.0 (最新バージョン) が必要な場合は、次のように動作させます。

  1. DevKitをインストールする

  2. 以下のコマンドを実行して、bluecloth をインストールします。

    gem install bluecloth

    これは「ネイティブ エクステンション」をビルドするときに惨めに失敗しますが、gem のソース コードは正常にインストールされます。

  3. 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

  4. bluecloth の gem インストール フォルダーに移動します。私にとって、これは以下のようになります。

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

  5. 次のコマンドを実行します。

    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

  6. bluecloth-2.2.0.gem の場所に移動し、次のコマンドを実行します。

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

于 2012-06-14T16:58:57.437 に答える
6

BlueCloth のバージョン 2.0.10 にバグ/問題があるようです。2.0.7 のような古いバージョンを使用してみることができます。

gem install bluecloth -v 2.0.7

これはうまくいくようです。

また、おそらくこれは最新バージョン (2.2.0?) をチェックする価値があり、動作しない場合は gem の作成者に報告してください:

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

于 2012-03-01T13:03:22.180 に答える
0

すでにパッチが含まれている github のフォークがあります。

https://github.com/drakontia/bluecloth

于 2015-10-16T19:49:51.350 に答える
0

This is the patched bluecloth.h code, for people in a hurry...

#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

于 2015-01-20T07:56:51.300 に答える