问题 如何在Windows上安装RedCloth?


跑步时 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

11601
2017-09-03 02:58


起源

尝试 gem install --no-rdoc RedCloth - drummondj
@John:它解决了第一个错误,但没有解决第二个错误。 - Misha Moroshko
好的 - 那我现在卡住了。 - drummondj


答案:


这是我的第二个错误“无法加载1.9 / redcloth_scan”的解决方法,这看起来像是Windows上的RedCloth的错误。后 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”,当然。


13
2017-09-05 15:12



或者添加一个 require 'redcloth_scan' 到redcloth.rb文件救援块...... jgarber.lighthouseapp.com/projects/13054-redcloth/tickets/... - rogerdpack


请务必根据错误消息命名目录。例如。对于Ruby 2.1和

LoadError: cannot load such file -- 2.1/redcloth_scan

一个人应该创建目录 “2.1” 在“lib”目录中并复制 redcloth_scan.so 它


0
2017-09-08 01:41