2017-02-02 47 views
2

所以我将Ckeditor更新为4.2。在我做完这件事之后,Ckeditor不再出现在制作中。相反,我在控制台中出现以下错误:Ckeditor在生产中不显示Rails

Uncaught TypeError: CKEDITOR.style.customHandlers[e.type] is not a constructor 

我请教了几个来源,包括这post,声称该问题是在预编译。我编辑了我的application.rb,在预编译中包含了Ckeditor,但它仍然不起作用。

require_relative 'boot' 

require 'rails/all' 

# Require the gems listed in Gemfile, including any gems 
# you've limited to :test, :development, or :production. 
Bundler.require(*Rails.groups) 


module DeployTest 
    class Application < Rails::Application 
    # Settings in config/environments/* take precedence over those specified here. 
    # Application configuration should go into files in config/initializers 
    # -- all .rb files in that directory are automatically loaded. 
    config.assets.precompile += Ckeditor.assets 
    config.assets.precompile += %w(ckeditor/*) 
    config.autoload_paths += %W(#{config.root}/app/models/ckeditor) 
    config.active_record.default_timezone = :local 
    config.time_zone = 'Eastern Time (US & Canada)' 
    end 
end 

古怪的是,当我转config.assets.debug = true,CKEDITOR再次开始工作,但我的CSS关闭。

为什么config.assets.debug有效?为什么它会关闭我的CSS?我怎样才能获得ckeditor的永久解决方案?

回答