Search code examples
cssruby-on-railsmarkdownredcarpetrouge

Rails asset css.erb is not loading


I'm configuring Markdown in Rails 4 with Redcarpet and Rouge. And I'm following this simple post

Everything is working fine (both in development and production) except that my file assets/stylesheets/rouge.css.erb seems not to be loading. And it looks like this now:

<%= Rouge::Themes::Github.render(:scope => '.highlight') %>

.highlight {
  background-color: #ffffff;
  padding: 25em;
}

.highlight .err {
    color: #ffffff;
    background-color: #ffffff;
}

Because whatever I put in it there would be no difference in the output, which looks the same, like this

enter image description here

And I guess syntax highlighting is not present for the same reason. And it doesn't work in both development and production. So what could be my mistake?

I'm a complete newbie to it and I may have missed something important. So tell me if you want me to provide any other info on this matter.

UPDATE 1

For those who sees a mistake in my using .css.erb and going to downvote me, see 2.3.1 in the rails documentation first


Solution

  • ok. I've found the answer myself. A couple of days ago I was searching for a solution for a problem of my production server being slow. And I found (here) a suggestion to set these two lines in development.rb to false

    config.action_mailer.raise_delivery_errors = false
    config.assets.debug = false
    

    and it turned out that the second line caused my problem. I returned it back to true and everything works. But i don't understand why it didn't affect bootstrap styles