因此,我将Ckeditor更新为4.2。完成此操作后,Ckeditor不再出现在生产中。相反,我在控制台中收到以下错误:
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的永久解决方案?
最佳答案
使用git的ckeditor gem为我解决了这个问题
gemfile:
gem 'ckeditor', github: 'galetahub/ckeditor'
https://github.com/galetahub/ckeditor/issues/719
关于javascript - Ckeditor不显示在生产Rails中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41994025/