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

undefined method `render' for Redcarpet::Render::SmartyPants:Module #801

Closed
groue opened this issue May 5, 2017 · 7 comments
Closed

undefined method `render' for Redcarpet::Render::SmartyPants:Module #801

groue opened this issue May 5, 2017 · 7 comments

Comments

@groue
Copy link

groue commented May 5, 2017

Hello,

I've just installed jazzy 0.8.1, and it can't generate documentation any longer:

$ jazzy \
  --clean \
  --author 'Gwendal Roué' \
  --author_url https://github.com/groue \
  --github_url https://github.com/groue/GRDB.swift \
  --github-file-prefix https://github.com/groue/GRDB.swift/tree/v0.107.0 \
  --module-version 0.107.0 \
  --module GRDB \
  --root-url http://groue.github.io/GRDB.swift/docs/0.107.0/ \
  --output Documentation/Reference \
  --podspec GRDB.swift.podspec
Analyzing dependencies
Fetching podspec for `GRDB.swift` from `/Users/groue/Documents/git/groue/GRDB.swift-master.swift`
...
/Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/jazzy_markdown.rb:151:in `render_param_returns': undefined method `render' for Redcarpet::Render::SmartyPants:Module (NoMethodError)
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/jazzy_markdown.rb:143:in `list_item'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/jazzy_markdown.rb:165:in `render'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/jazzy_markdown.rb:165:in `render'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:316:in `make_doc_info'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:382:in `block in make_source_declarations'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:343:in `each'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:343:in `make_source_declarations'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:328:in `make_substructure'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:383:in `block in make_source_declarations'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:343:in `each'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:343:in `make_source_declarations'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:345:in `block in make_source_declarations'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:343:in `each'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:343:in `make_source_declarations'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/sourcekitten.rb:618:in `parse'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/doc_builder.rb:146:in `build_docs_for_sourcekitten_output'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/lib/jazzy/doc_builder.rb:78:in `build'
	from /Users/groue/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/jazzy-0.8.1/bin/jazzy:15:in `<top (required)>'
	from /Users/groue/.rbenv/versions/2.2.2/bin/jazzy:23:in `load'
	from /Users/groue/.rbenv/versions/2.2.2/bin/jazzy:23:in `<main>'
@groue
Copy link
Author

groue commented May 5, 2017

To reproduce, you can download GRDB.swift, checkout the tag v0.107.0, and run make doc.

@groue
Copy link
Author

groue commented May 5, 2017

When redcarpet is used alone, Redcarpet::Render::SmartyPants.render is defined:

gem "redcarpet" # true
require "redcarpet" # true
Redcarpet::Render::SmartyPants.render("you're") # "you&rsquo;re"

However, as soon as jazzy is there, there is an error:

gem "jazzy" # true
require "jazzy" # true
require "redcarpet" # false
# NoMethodError: undefined method `render' for Redcarpet::Render::SmartyPants:Module
Redcarpet::Render::SmartyPants.render("you're")

For context:

$ ruby --version
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin15]

@groue
Copy link
Author

groue commented May 5, 2017

This bug is fixed with Ruby 2.4.1.

@groue groue closed this as completed May 5, 2017
@johnfairh
Copy link
Collaborator

johnfairh commented May 5, 2017

Hi - you're just ahead of me -- I did the development of this change on 2.0.0, have installed 2.2.2 just now + built your project docs fine no I didn't, I got confused - it fails.

Can you let us know what the problem was you identified as fixed in 2.4.1?

@groue
Copy link
Author

groue commented May 5, 2017

Hello @johnfairh. I don't quite know what the problem was. Can't you reproduce the following error with Ruby 2.2.2?

gem "jazzy" # true
require "jazzy" # true
require "redcarpet" # false
# NoMethodError: undefined method `render' for Redcarpet::Render::SmartyPants:Module
Redcarpet::Render::SmartyPants.render("you're")

For the full picture: macOS 10.12.4, rbenv 1.1.0, .ruby-version file containing 2.2.2, and Ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin15] installed.

@johnfairh
Copy link
Collaborator

I can now, thanks - was getting confused by what version of everything I was running before.
So 2.0.0 OK, 2.4.1 OK, 2.2.2 not OK. Will look...

@johnfairh
Copy link
Collaborator

Well. The singleton_methods of that module both seem to be missing directly after jazzy require's redcarpet, even before it references any symbols from there. I also see this problem only when running from an installed gem, rather than directly from the repo. My ruby is weak so maybe this means something -- but looking at the redcarpet code I can see another way of calling smartypants to avoid this, that seems to work properly everywhere.

@jpsim jpsim closed this as completed May 5, 2017
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

3 participants