Andreas Lyngstad
Andreas Lyngstad

Reputation: 4927

Rails 3.1 on heroku ckeditor

I have a big problem with the ckeditor "3.7.0.rc2" gem.

In development it works great with s3 a backend for uploading.

But on heroku it does not work.

The problem is that the ckeditor/vendor/skins/(kama) or (office2003) or (v2) /editor.css files contains an error that makes the sass compiler scream. The error like this "filter:;", since there is no value it does not work.

There is no point in change the files locally, because heroku downloads the gem as I deploy.

I have tried to package the gem locally and make my own git fork and install it for there. But, then the

RAILS_ENV=production bundle exec rake assets:precompile  

command precompiles all files in the ckeditor folders and always ends in

rake aborted! Permission denied

When I precompile with the "3.7.0.rc2" gem installed, some ckeditor js files are precompiled but not all.

How can I get around this problem?

Upvotes: 2

Views: 1066

Answers (2)

Andreas Lyngstad
Andreas Lyngstad

Reputation: 4927

The solution was to fork the git repo, delete all unnecesarry and correct the errors. js files. Then the precompiling worked and now the app is running on heroku.

Here's a link to my fork https://github.com/andreaslyngstad/ckeditor

It worked in my project, but I have deleted js files that I did not use, so if you are using some of them, this is not for you.

Upvotes: 0

Aj Gu
Aj Gu

Reputation: 1439

When you fork ckeditor gem and use the forked git path in Gemfile heroku will pull the sources of ckeditor from your forked git repo instead of the gem. This should fix the issue.

Other thing that you could try is precompile the assets in your development machine and push the assets to heroku. This will make sure that heroku will not precompile those assets. More info is available at http://devcenter.heroku.com/articles/rails31_heroku_cedar. This will run only on cedar stack

Upvotes: 1

Related Questions