小编Tra*_*ill的帖子

RedCloth打破了我的Rails 3博客

像纺织这样的帖子感觉非常必要,但这给了我各种令人头疼的问题.bundle package并且bundle install都正常工作,并确认RedCloth设置为最新的稳定版本(4.2.2).现在我在ruby 1.9.2p0和rails 3.0.7上.

但是,当我尝试运行本地服务器时,我看到:

LoadError in PostsController#index

no such file to load -- RedCloth

...

app/controllers/posts_controller.rb:1:in `<top (required)>'

This error occurred while loading the following files:
   RedCloth
Run Code Online (Sandbox Code Playgroud)

posts_controller中的第1行是require 'RedCloth'.除了添加json格式和私有身份验证方法之外,我没有对基本的Rails脚手架进行任何其他更改,这两种方法都不应该影响这一点.

我正在使用部分来渲染我的帖子.它目前看起来像这样:

<% div_for post do %>
  <h2><%= link_to_unless_current h(post.title), post %> </h2>
  <%= RedCloth.new(post.body).to_html %>
<% end %>
Run Code Online (Sandbox Code Playgroud)

的Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.7'

gem 'sqlite3'
gem 'rake-compiler'
gem 'RedCloth'

group :development, :test do
  gem 'webrat'
  gem 'rspec'
  gem 'rspec-rails'
end
Run Code Online (Sandbox Code Playgroud)

(rake-compiler是试图按照这些说明进行的,顺便说一句:http …

ruby rubygems redcloth ruby-on-rails-3

5
推荐指数
1
解决办法
1890
查看次数

标签 统计

redcloth ×1

ruby ×1

ruby-on-rails-3 ×1

rubygems ×1