Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NameError: uninitialized constant GitHub::Markup::Markdown::RedcarpetCompat #385

Closed
bmfreitas opened this issue Oct 20, 2014 · 8 comments
Closed

Comments

@bmfreitas
Copy link

I've got a NameError when following the README instructions.

All the steps:

$ ruby -v
ruby 2.1.3p242 (2014-09-19 revision 47630) [x86_64-darwin13.0]

$ gem install redcarpet
Building native extensions.  This could take a while...
Successfully installed redcarpet-3.2.0
1 gem installed

$ gem install github-markup
Successfully installed github-markup-1.3.0
1 gem installed

$ irb
2.1.3 :001 > require 'github/markup'
=> true
2.1.3 :002 > GitHub::Markup.render('README.markdown', "* One\n* Two")
NameError: uninitialized constant GitHub::Markup::Markdown::RedcarpetCompat
    from /Users/bmsatierf/.rvm/gems/ruby-2.1.3@rails/gems/github-markup-1.3.0/lib/github/markup/markdown.rb:11:in `block in <class:Markdown>'
    from /Users/bmsatierf/.rvm/gems/ruby-2.1.3@rails/gems/github-markup-1.3.0/lib/github/markup/markdown.rb:44:in `call'
    from /Users/bmsatierf/.rvm/gems/ruby-2.1.3@rails/gems/github-markup-1.3.0/lib/github/markup/markdown.rb:44:in `render'
    from /Users/bmsatierf/.rvm/gems/ruby-2.1.3@rails/gems/github-markup-1.3.0/lib/github/markup.rb:23:in `render'
    from (irb):2
    from /Users/bmsatierf/.rvm/rubies/ruby-2.1.3/bin/irb:11:in `<main>'

Not sure if it would matter: Xcode version 6.0.1 (6A317)

Am I missing something?

@pchaigno
Copy link
Contributor

Seeing the Travis build file I'd say that Ruby 2.1.3 is not supported yet.

The error comes from this line. RedcarpetCompat seems to be deprecated with the last version of Redcarpet.

I got it working with Ruby 2.1.3 by changing the faulty line with: Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(content).
@bkeepers Should I open a pull request with this change?

@bkeepers
Copy link
Contributor

@pchaigno that would be great! I see we don't have any tests for the other markdown renders, but it would be nice if we could at least test that all the calls to each markdown gem actually work.

@pchaigno
Copy link
Contributor

@bkeepers PR opened at #387.

it would be nice if we could at least test that all the calls to each markdown gem actually work.

They would need to be added to the Gemfile no? Currently rdiscount, maruku, kramdown and bluecloth are missing from the Gemfile.
I'm not sure I understand how all this works but I tested the calls to each gems manually and I had to add them to the Gemfile.

@samuelg0rd0n
Copy link

I'm getting the same error with Ruby 2.0.0p481. I was able to fix it with the hint by @pchaigno but a more stable solution would be nice :-)

@wieczorek1990
Copy link

24 days guys...

gem 'github-markup', github: 'pchaigno/markup'

@pchaigno
Copy link
Contributor

This is solved with #387. It should be in the next release.

@bkeepers
Copy link
Contributor

I just pushed 1.3.1, which includes a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants
@bkeepers @bmfreitas @wieczorek1990 @pchaigno @samuelg0rd0n and others