当前位置 : 主页 > 编程语言 > ruby >

ruby-on-rails – 使用RedCloth 4.2.2 gem在Rails 3.0.1中未初始化的常量

来源:互联网 收集:自由互联 发布时间:2021-06-23
我在本地应用程序中使用RedCloth时遇到问题.我一直收到以下错误: uninitialized constant ActionView::CompiledTemplates::RedCloth 发生这种情况是因为我有以下代码: %= RedCloth.new("Some text").to_html % 我
我在本地应用程序中使用RedCloth时遇到问题.我一直收到以下错误:

uninitialized constant ActionView::CompiledTemplates::RedCloth

发生这种情况是因为我有以下代码:

<%= RedCloth.new("Some text").to_html %>

我试图做的是把它放在environment.rb文件中:

require "RedCloth"

但是,当我这样做时,我的Phusion Passenger Nginx配置出现了一个巨大的错误,我在下面的论坛中详细介绍过:http://railsforum.com/viewtopic.php?id=42560

任何帮助都会很棒.谢谢!

确保你的Gemfile中有一个gem’RedCloth’.无论您的系统中实际安装了哪些宝石,Rails都只会使用Gemfile中列出的宝石.您也不需要require“RedCloth”语句.
网友评论