2011-12-29 5 views
3

Windows版のbluecloth gemを更新しようとすると、エラーメッセージが表示されます。 Windows用にインストールする必要のあるバージョンと、使用可能なBluetooth用の代替バージョンがありますか?残念ながら私の開発環境は厳密には私が扱っている他のソフトウェアのためWindowsです。そうでなければLinux環境を使用します。Ruby 1.9.2でruby bluecloth gemをインストールまたは更新できません。

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

は、以前に宝石をインストールしていました'gem install bluecloth'? – Ramy

答えて

3

これは、Cの拡張機能は、WindowsでのコンパイルをブロックしているBlueClothに含まにヘッダが含まれているためと思われる:

は、ここで私は何を得るのコピーペーストです。

次のパッチを適用する:

https://gist.github.com/1539611

コンパイルした作品。

おそらく、問題を宝石作家に報告できますか?

http://deveiate.org/projects/BlueCloth https://github.com/ged/bluecloth

お役に立てば幸いです。

3

2.2.0のヘッダーファイルは、ウィンドウでのblueclothのコンパイルを防ぎます。ただし、自分でパッチを当てることはできます。 Luis Lavenaの言葉通り、パスを適用する必要があります。

  1. 実行gem install bluecloth -v '2.2.0'お持ちでない場合は

  2. 2.2.0ディレクトリをblueclothする

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h

  3. ゴーに位置している私のマシン上で、bluecloth.hファイルにthis patchを適用します例えば、

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0

  4. 実行rake gem(これには追加の宝石をいくつかインストールする必要があります)。

    はその後、パッチを適用した宝石を

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem

  5. オープンで、このディレクトリを作成した.gemファイルを参照してインストールする必要があります。

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

+1

おかげさまで、ありがとうございました。でも、それは自分のディレクトリから完全に宝石を一掃しました。あなたは最初にそれをコピーするとは言わなかった。 –

+0

私はパッチを適用しましたが、解決するために探していたのと同じエラーが発生しています。しかし、このトピックとは異なり、私の小切手はいくつかの要件を見つけることはできません。 srandom()... noを確認しています random()...いいえを確認しています rand()をチェックしていません string.hのbzero() strings.h ...いいえ strcmp()のチェックstacmp()...いいえ この拡張機能にはstrcasecmp()またはstricmp()が必要です。devkitを再インストールしてもう一度やり直す必要がありますか? –

関連する問題