我正在使用rails 3.0.3,我最近在我的文章中安装了ckeditor来添加文本编辑器。在添加此编辑器之前,一切正常。但是在安装ckeditor之后(紧随其后:https://github.com/hificreative/rails-3-ckeditor)我我在文章页面中获取文本编辑器,但我在控制台中收到路径错误,我无法在单击保存按钮时保存数据...
控制台输出:
Started GET "/javascripts/reset.js" for 127.0.0.1 at Fri Mar 23 13:28:19 +0530 2012
ActionController::RoutingError (No route matches "/javascripts/reset.js"):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.5ms)
Started GET "/javascripts/grid.js" for 127.0.0.1 at Fri Mar 23 13:28:19 +0530 2012
ActionController::RoutingError (No route matches "/javascripts/grid.js"):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms)
Started GET "/javascripts/style.js" for 127.0.0.1 at Fri Mar 23 13:28:19 +0530 2012
ActionController::RoutingError (No route matches "/javascripts/style.js"):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (2.2ms)
ActionController::RoutingError (No route matches "/javascripts/style.js"):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (2.2ms)
Started GET "/javascripts/messages.js" for 127.0.0.1 at Fri Mar 23 13:28:19 +0530 2012
ActionController::RoutingError (No route matches "/javascripts/messages.js"):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.8ms)
Started GET "/javascripts/forms.js" for 127.0.0.1 at Fri Mar 23 13:28:19 +0530 2012
ActionController::RoutingError (No route matches "/javascripts/forms.js"):
Rendered /usr/lib/ruby/gems/1.8/gems/actionpack-3.0.3/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (1.4ms)
我在我的gemfile中包含以下内容:
gem 'ckeditor', '3.5.0'
以下是我安装ckeditor时所遵循的步骤:
Next step is generate ckeditor js files and configuration file Check “config/initializers/ckeditor.rb” for more configuration options:
rails generate ckeditor:base
Generate ckeditor models for file upload support: For paperclip:
rails generate ckeditor:migration
For attachment_fu:
rails generate ckeditor:migration --backend=attachment_fu
Don’t forget about migration:
rake db:migarte
包含在我的lauout.application.html.haml文件中的以下行
= javascript_include_tag :ckeditor
并在我的文章_form.html.haml文件中写了以下一行
form.cktext_area :content
如何解决这个错误.....
答案 0 :(得分:0)
尝试在config / application.rb文件中添加:
config.autoload_paths += %W( #{config.root}/app/models/ckeditor )
如果您需要在编辑器中附加图像,请在:〜/ .rvm / gems / ree-xxx-20xx.xx / gems / ckeditor-xxxpre / lib / ckeditor / engine.rb
config.autoload_paths << File.expand_path(File.join(File.dirname(__FILE__), ".."))
答案 1 :(得分:0)
我不确定我可以帮助使用这个特定的宝石,但我刚刚使用这个宝石安装成功。
答案 2 :(得分:-1)
好的,我刚刚重新启动电脑,然后一切正常,没有出现此错误。