ActionView::Template::Error (couldn't find file 'ckeditor/init' with type 'application/javascript') Checked in these paths: /Users/zhuzhuchen/rails101/app/assets/config /Users/zhuzhuchen/rails101/app/assets/images /Users/zhuzhuchen/rails101/app/assets/javascripts /Users/zhuzhuchen/rails101/app/assets/stylesheets /Users/zhuzhuchen/rails101/vendor/assets/javascripts /Users/zhuzhuchen/rails101/vendor/assets/stylesheets /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/ckeditor-4.4.0/app/assets/images /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/ckeditor-4.4.0/app/assets/javascripts /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/ckeditor-4.4.0/app/assets/stylesheets /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/jquery-rails-4.3.3/vendor/assets/javascripts /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/coffee-rails-4.2.2/lib/assets/javascripts /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actioncable-5.0.7.1/lib/assets/compiled /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/turbolinks-source-5.2.0/lib/assets/javascripts /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/bootstrap-sass-3.3.7/assets/stylesheets /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/bootstrap-sass-3.3.7/assets/javascripts /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/bootstrap-sass-3.3.7/assets/fonts `/Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/bootstrap-sass-3.3.7/assets/images): 4:
Rails101 5: <%= csrf_meta_tags %> 6: 7: <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %> 8: <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %> 9: 10:app/assets/javascripts/application.js:17 app/views/layouts/application.html.erb:7:in_app_views_layouts_application_html_erb__4471122603424365335_70331191397360' Rendering /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout Rendering /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb Rendered /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/_source.html.erb (3.6ms) Rendering /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb Rendered /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/_trace.html.erb (1.5ms) Rendering /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb Rendered /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/_request_and_response.html.erb (0.7ms) Rendered /Users/zhuzhuchen/.rvm/gems/ruby-2.3.1/gems/actionpack-5.0.7.1/lib/action_dispatch/middleware/templates/rescues/template_error.html.erb within rescues/layout (79.6ms)
安装gem 'ckeditor'
在app/assets/javascripts/application.js加入一行//= require ckeditor/init
在config/initializers/assets.rb加入一行Rails.application.config.assets.precompile += %w( application.css application.js ckeditor/* )
修改了 new 的 simple_formf.input :description, as: :ckeditor