投稿用のテキスタイルのようなものはかなり必要だと感じますが、これは私にあらゆる種類の頭痛の種を与えています。bundle package
両方ともbundle install
正常に動作しており、RedClothが最新の安定したリリース(4.2.2)に設定されていることを確認します。現在、私はRuby1.9.2p0とRails3.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
post_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 %>
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
(rake-compilerは、これらの指示に従おうとしたところにあります。ところで:http ://www.ruby-forum.com/topic/484752 [ruby 1.9.1と1.9.2の両方で試しましたが、サイコロはありません。私はここにいないでしょう])
TIA :)