I am trying to get the markdown up and running on my webapp using pygment 0.6.3 and redcarpet 3.3. Unfortunately, I am facing a wall here when calling the markdown method:
uninitialized constant ApplicationHelper::Redcarpet
Here is the module I am calling from application_helper.rb:
module ApplicationHelper
def markdown(content)
renderer = Redcarpet::Render::HTML.new(hard_wrap: true, filter_html: true)
options = {
autolink: true,
no_intra_emphasis: true,
disable_indented_code_blocks: true,
fenced_code_blocks: true,
lax_html_blocks: true,
strikethrough: true,
superscript: true
}
Redcarpet::Markdown.new(renderer, options).render(content).html_safe
end
end
I am therefore call this method the following way:
<div id= "content">
<%= markdown @post.content%>
</div>
Among other researches, I already did the following:
- bundle update
- bundle install
- restart my server
- tried other versions of pygments and redcarpet
I've found some info saying I should remove the Gemfile.lock (when deleting it, it automatically pops up again).
Thank you for your help on this.
Edit: Added Gemfile
source 'https://rubygems.org'
gem 'rails', '~> 5.0.0', '>= 5.0.0.1'
gem 'sqlite3'
gem 'puma', '~> 3.0'
gem 'sass-rails', '~> 5.0'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.2'
gem 'jquery-rails'
gem 'turbolinks', '~> 5'
gem 'jbuilder', '~> 2.5'
gem 'pygments.rb', '~> 0.6.3'
gem 'redcarpet', '~> 3.3', '>= 3.3.4'
group :development, :test do
gem 'byebug', platform: :mri
end
group :development do
gem 'web-console'
gem 'listen', '~> 3.0.5'
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
end
gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby]