Question

I'm trying to use the BlueCloth gem in order to parse some markdown for my rails app. I added it to my gem file:

    gem 'BlueCloth'

In my .html.erb views I user the code

    <%=  BlueCloth.new(post.content).to_html.html_safe %>

To render the markdown as html. This works completely fine in my local dev environment, but when I push to heroku, even after running bundle install and restarting the app, accessing the app generates internal server errors.

I get the following error in the logs:

    ActionView::Template::Error (uninitialized constant ActionView::CompiledTemplates::BlueCloth):

I include BlueCloth in the gem file:

source 'https://rubygems.org'

gem 'rails', '3.2.8'

gem 'pg'

group :assets do
  gem 'sass-rails',   '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

gem 'devise'
gem 'BlueCloth'

I have also run the command bundle install via the heroku command line.

Thanks for the help!

Was it helpful?

Solution 2

The issue was that I was using the old version of the BlueCloth gem.

The old gem is called BlueCloth and the new one is called bluecloth

Changing the line in my gem file:

    gem 'BlueCloth'

To:

    gem `bluecloth`

Fixed it.

Thanks.

OTHER TIPS

It looks like your manually requiring files. It might be easier for you if you use bundler to require everything for you and then you dont have to add require to any other .rb file. Its very simple to do this. Depending on your Rails version, here are two links that should help you out:

Rails 2.3

Rails 3

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top