Как установить RedCloth на Windows? - PullRequest
11 голосов
/ 03 сентября 2011

При запуске gem install RedCloth (в Windows XP) я получил:

Fetching: RedCloth-4.2.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed RedCloth-4.2.8
1 gem installed
Installing ri documentation for RedCloth-4.2.8...
Installing RDoc documentation for RedCloth-4.2.8...
ERROR:  While generating documentation for RedCloth-4.2.8
... MESSAGE:   error generating index.html: Error while evaluating D:/Programs/R
uby/lib/ruby/gems/1.9.1/gems/rdoc-3.9/lib/rdoc/generator/template/darkfish/index
.rhtml: undefined method `[]' for nil:NilClass (RDoc::Error)
... RDOC args: --op D:/Programs/Ruby/lib/ruby/gems/1.9.1/doc/RedCloth-4.2.8/rdoc
 --charset=UTF-8 --line-numbers --title RedCloth --main README.rdoc lib lib/case
_sensitive_require ext README.rdoc COPYING CHANGELOG --title RedCloth-4.2.8 Docu
mentation --quiet

Почему я получаю эту ошибку?

Затем я добавил require 'RedCloth' к config/environment.rb, ипопытался запустить rails s, но, к сожалению, я получил:

D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.8/lib/redcloth.rb:12:in `
require': no such file to load -- 1.9/redcloth_scan (LoadError)
Couldn't load 1.9/redcloth_scan
The $LOAD_PATH was: ...

Что я делаю не так?

Я использую Rails 3.0.1, Ruby 1.9.2.

bundle show RedCloth

=> D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.8

Ответы [ 2 ]

13 голосов
/ 05 сентября 2011

Вот мой обход второй ошибки: «Не удалось загрузить 1.9 / redcloth_scan», которая выглядит как ошибка RedCloth в Windows. После gem install RedCloth --no-rdoc я запускаю

cd c:\Ruby192\lib\ruby\gems\1.9.1\gems\RedCloth-4.2.8\lib
mkdir 1.9
copy redcloth_scan.so 1.9

Вы должны заменить этот каталог своим путем, "D: \ Programs \ Ruby \ lib \ ruby ​​\ gems \ 1.9.1 \ gems \ RedCloth-4.2.8 \ lib", конечно.

0 голосов
/ 08 сентября 2015

Обязательно назовите каталог в соответствии с сообщением об ошибке. Например. для Ruby 2.1 и

LoadError: cannot load such file -- 2.1/redcloth_scan

Нужно создать каталог "2.1" в каталоге "lib" и скопировать redcloth_scan.so в него

...