#安裝easy fckeditor插件,需要首先安裝git
ruby script/plugin install git://github.com/gramos/easy-fckeditor.git

#使用rake安裝fckeditor
rake fckeditor:install
** Installing FCKEditor Plugin version 0.8.1
Creating directory editor
Creating directory css
Creating directory behaviors
  Installing file disablehandles.htc
  Installing file showtableborders.htc
  Installing file fck_editorarea.css
  Installing file fck_internal.css
  Installing file fck_showtableborders_gecko.css
Creating directory images
  Installing file block_address.png
  Installing file block_blockquote.png
  Installing file block_div.png
.
.
.
  Installing file fckplugin.js
  Installing file _upgrade.html
  Installing file _whatsnew.html
  Installing file _whatsnew_history.html
** Successfully installed FCKEditor Plugin version 0.8.1

#在需要使用Fckeditor的頁面引入fckeditor.js文件
<%= javascript_include_tag :fckeditor  %>

#使用fckeditor_textarea
<%= fckeditor_textarea :article, :body, {:toolbarSet => 'Easy', :width => '100%', :height => '300px'%>

#更詳細的使用說明,可以參看http://github.com/gramos/easy-fckeditor/tree/master

解決上傳圖片問題

1. 在上傳圖片的時候(rails2.2.2),會出現如下的錯誤:

NoMethodError (undefined method `relative_url_root' for #<ActionController::CgiRequest:0x594ab4c>):
解決方法參考 http://github.com/salicio/fckeditor/commit/fcf8fbee8cfad3a3df0df50172e448727909ccb9
1. 將/vendor/plugins/easy_fckeditor/app/controllers/fckeditor_controller.rb中的
uploaded = request.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
修改為:
uploaded = ActionController::Base.relative_url_root.to_s+"#{UPLOADED}/#{params[:Type]}"
2. 將/vendor/plugins/easy_fckeditor/lib/fckeditor.rb中的
js_path = "#{controller.relative_url_root}/javascripts"
修改為:
js_path = "#{ActionController::Base.relative_url_root}/javascripts"

2. 該plugins版本少定義了一個變量:
會出現如下錯誤:
NameError (uninitialized constant FckeditorController::UPLOADED):

修改很簡單,只要修改
/vendor/plugins/easy_fckeditor/app/controllers/fckeditor_controller.rb,增加:
UPLOADED = "/uploads"

完成之后,能夠正常上傳圖片,并預覽。