How to install RedCloth on Windows?
Asked Answered
M

2

11

When running gem install RedCloth (on Windows XP) I got:

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

Why do I get this error ?

Then I added require 'RedCloth' to config/environment.rb, and tried to run rails s, but unfortunately I got:

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

What am I doing wrong ?

I use 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
Marianelamariani answered 3/9, 2011 at 2:58 Comment(3)
Try gem install --no-rdoc RedClothSecund
@John: It solves the first error, but not the second one.Marianelamariani
OK - then I'm stuck now.Secund
A
13

Here is my workaround to your second error, "Couldn't load 1.9/redcloth_scan", which looks like a bug of RedCloth on Windows. After gem install RedCloth --no-rdoc, I run

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

You should replace that directory with your path, "D:\Programs\Ruby\lib\ruby\gems\1.9.1\gems\RedCloth-4.2.8\lib", of course.

Aryn answered 5/9, 2011 at 15:12 Comment(1)
or add a require 'redcloth_scan' to the redcloth.rb file rescue block... jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/…Lorrinelorry
A
0

Be sure to name the directory according to the error message. E.g. for Ruby 2.1 and

LoadError: cannot load such file -- 2.1/redcloth_scan

One should create the directory "2.1" in the "lib" directory and copy redcloth_scan.so to it

Amelioration answered 8/9, 2015 at 1:41 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.