Bluecloth v2.0.10 с windows 7 не работает
С Ruby 187 я скачал devkit с http://rubyinstaller.org/downloads и следовал инструкциям по 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 ответа
Если вам нужна 2.2.0 (последняя версия), вот как я ее получил:
Установите DevKit
Запустите команду ниже, чтобы установить bluecloth:
gem install bluecloth
это с треском провалится при сборке "собственных расширений", но успешно установит исходный код гема.
Патч 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
Перейдите в папку установки драгоценного камня bluecloth. Для меня это выглядит так:
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. Для меня это найдено здесь:
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 и выполните следующую команду:
gem install bluecloth-2.2.0.gem --platform=ruby
Кажется, есть ошибка / проблема с версией 2.0.10 BlueCloth. Вы можете попробовать использовать более старую версию, такую как 2.0.7:
gem install bluecloth -v 2.0.7
Который, кажется, работает.
Также, возможно, стоит проверить последнюю версию (2.2.0?) И, если она не работает, сообщить об этом автору gem:
На github есть форк, который уже включает патч:
Это исправленный код bluecloth.h, для людей, которые спешат...
#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