0

I've been trying to tackle this all morning. Locally, this setup works just fine. I am not using the redactor-rails gem because this is a rails 4 app and it doesn't support it. I have moved the redactor.css and redactor.js calls from the active_admin initializer file to be required in my actice_admin.js.coffee and active_admin.css files because on Heroku, it could not find the path. Now, when firing up the page that should be displaying redactor, I get has no method 'redactor' in the console.

I'm at a loss. I've read up on precompiling assets and the how the pipeline works, but it doesn't seem like I'm doing anything out of the ordinary here.

So how can I deploy to Heroku without this error?

1 Answer 1

0

Ok, so I seemed to have disregarded an important task. After thinking about precompilation a bit more I remembered I had been told to run

RAILS_ENV=production bundle exec rake assets:precompile

before. After running that again, it precompiled the active_admin.css and active_admin.js.coffee files which had the new require's in it. Viola!

Hope this helps someone else in the future.

2
  • 1
    Better yet, Heroku will precompile all assets for you (and you won't have to store them in the git repo) if you remove any existing precompiled assets from /public/assets. Cheers!
    – Donovan
    Dec 13, 2013 at 17:04
  • @Donovan you are right. And that's actually the correct method. For whatever reason, Redactor was not showing with a regular deployment to Heroku. My approach must have fixed something. So I deleted my public/assets contents so my local app wouldn't read those stylesheets, etc. first.
    – chris_s
    Dec 13, 2013 at 19:10

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.