11

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、Ruby1.9.2を使用しています。

bundle show RedCloth

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

2 に答える 2

13

これが、2番目のエラー「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」に置き換える必要があります。

于 2011-09-05T15:12:46.847 に答える
0

エラーメッセージに従ってディレクトリに名前を付けてください。たとえば、Ruby2.1および

LoadError: cannot load such file -- 2.1/redcloth_scan

「lib」ディレクトリに「2.1」ディレクトリを作成し、そこにコピーredcloth_scan.soする必要があります

于 2015-09-08T01:41:53.810 に答える