Take the 2-minute tour ×

I have an application that uses redactor (a wysiwyg editor) it works perfectly locally, and it also works when I upload it, except the config file, which is located in a subfolder doesent do anything, when pushing to Heroku. I tried precompiling, using:

RAILS_ENV=production bundle exec rake assets:precompile


bundle exec rake assets:precompile

I have config.assets.enabled = false

The config.js file, that is not working on Heroku, is included in application.js as redactor-rails/config

What can be the problem ?

share|improve this question
add comment

1 Answer

up vote 2 down vote accepted

Have you added config.js to your local git repository before pushing?


A couple more things to check. Are you using the redactor-rails gem, and if so, is it in your gemfile?

gem 'jquery-rails'
gem 'redactor-rails'

Is your gemfile.lock checked into git?

[Edit 2]

I've now tested this out, and indeed, there's an issue with redactor-rails, which causes custom config to be overwritten by the gem's default.

On the github repo, there is a solution, which I've tested on heroku, and copied here:

rails generate redactor:config generates the file app\assets\redactor-rails\config.js. This will not work in the asset pipeline correctly as the rake assets:precompile task will still take config.js from the gem instead of the app (not that it'll work fine in development though). See Overriding backend assets in production environment

The solution is to create your own config.js (or any file name) and put it anywhere in your >app's assets. Then when requiring redactor, instead of //= require redactor-rails, use:

//= require redactor-rails/redactor.min
//= require path/to/custom/config

Works for me. Hope that helps. https://github.com/SammyLin/redactor-rails/issues/16

share|improve this answer
Works! - I forgot to re-compile using: RAILS_ENV=production bundle exec rake assets:precompile. But after that it works.. awesome! –  jakobk Sep 12 '12 at 10:19
hi guys, did the same steps, but didn't work for me, using it on heroku, any ideas? –  Said Kaldybaev Feb 10 '13 at 15:38
If you did the above and it didn't work -- be sure you're not using jQuery 1.9, which broke redactor for me. jquery-rails 2.2.0 packages jquery 1.9. Specify jquery-rails ~> 2.1.4 in your gemfile. –  Jamie Feb 11 '13 at 21:01
add comment

Your Answer


