现在的位置: 首页 > 综合 > 正文

Missing these required gems: RedCloth解决方案

2012年12月14日 ⁄ 综合 ⁄ 共 681字 ⁄ 字号 评论关闭

在windows下安装RedCloth时,明明使用gem install RedCloth已经安装成功,而且能够通过gem list RedCloth -d能看到安装的地址,但在rails程序加载时还是说不能找到RedCloth,经过长久的google之后得知原来是RedCloth的错误,这种错误好像只是在windows+rails2.3时才会出现。具体解决方法如下:
(1)更改environment.rb, 将config.gem "RedCloth"更改为config.gem "RedCloth", :lib => 'redcloth'
(2)找到RedCloth的安装路径,比如D:\Ruby187\lib\ruby\gems\1.8\gems\RedCloth-4.2.8\,进入D:\Ruby187\lib\ruby\gems\1.8\gems\RedCloth-4.2.8\ext,在此目录下新建一个名为1.8的文件夹[具体版本号应该同当前所安装的ruby大版本一致],将redcloth_scan中的所有内容全部copy到刚才新创建的文件夹中

其实可以通过运行D:\Ruby187\bin\redcloth.bat来发现是因为无法在指定目录找到redcloth_scan相关动态库所导致的错误,默认是在D:\Ruby187\lib\ruby\gems\1.8\gems\RedCloth-4.2.8\ext\1.8下去找,而不是redcloth_scan目录,这也可以说是RedCloth制作的失误吧

需要注意的是,在安装RedCloth时需要先安装ruby DevKit!

抱歉!评论已关闭.