CKEditor with Bootstrap Skin Pre-Build Issue in Rails 4 Release

I am trying to use the bootstrap skin for ckeditor in rails 4. Everything works fine in development, but I get precompilation of a production error.

I added ckeditor gem ( https://github.com/galetahub/ckeditor ). Then download the boot skin from ( https://github.com/Kunstmaan/BootstrapCK4-Skin/tree/master/skins/bootstrapck )

I added the contents of the skin to vendor / assests / javascript / ckeditor / skins

and added ckeditor to precompile the array. Rails.application.config.assets.precompile + =% w (ckeditor / *)

In precompiling assets, I get the error Sass :: SyntaxError: Undefined.

There are several scss files in the skin folder, such as vendor / assets / javascripts / ckeditor / skins / bootstrapck / scss / components / _colorpanel.scss which have variables, for example, in the above file, a variable for colors like $ gray (from bootstrap, I I guess).

I think that the scss files in the provider folder cannot access the variables and other scss from the application / assets in the precompilation task.

Any idea how I can fix this, or is this really the right way to add an extra skin to the vendor folder?

rails 4.1.4 sass-rails 4.0.4 ckeditor 4.1.1

appreciate any help.

+7
ruby-on-rails ckeditor
source share
1 answer

You can add

@import "../config/config"; 

at the top of most scores in

 vendor/assets/javascripts/ckeditor/skins/bootstrapck/scss/components/ 

and

 @import "colors"; 

up

 vendor/assets/javascripts/ckeditor/skins/bootstrapck/scss/config/_defaults.scss 

for it to work.

This is not very DRY, but at least skin assets will be precompiled.

+3
source share

All Articles