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 version error #82

Closed
npcventures opened this issue Aug 8, 2014 · 2 comments
Closed

undefined method version error #82

npcventures opened this issue Aug 8, 2014 · 2 comments

Comments

@npcventures
Copy link

Hi, I was attempting to follow the doc here (http://jekyllrb.com/docs/continuous-integration/) and found an interesting error when running bundle exec htmlproof ./_site.

/Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/html-proofer-1.1.5/bin/htmlproof:11:in `block in <top (required)>': undefined method `version' for nil:NilClass (NoMethodError)
    from /Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/mercenary-0.3.4/lib/mercenary.rb:21:in `program'
    from /Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/html-proofer-1.1.5/bin/htmlproof:10:in `<top (required)>'
    from /Users/me/.rbenv/versions/1.9.3-p547/bin/htmlproof:23:in `load'
    from /Users/me/.rbenv/versions/1.9.3-p547/bin/htmlproof:23:in `<main>'

This happens to me on both CI (Shippable, Ubuntu 12.04) as well as a local environment (OSX 10.9.2, ruby 1.9.3p547). I installed the gem through bundle install.

A quick fix is commenting out line 11 in bin/htmlproof:

p.version Gem::Specification::load(File.join(File.dirname(__FILE__), "..", "html-proofer.gemspec")).version

This suggests that the "html-proofer.gemspec" file is missing, and indeed it is:

$ cd /Users/me/.rbenv/versions/1.9.3-p547/lib/ruby/gems/1.9.1/gems/html-proofer-1.1.5/
$ ls -l
drwxr-xr-x  3 me  staff   102 Aug  7 22:38 bin
drwxr-xr-x  3 me  staff   102 Aug  7 22:23 lib
$ curl -O https://raw.githubusercontent.com/gjtorikian/html-proofer/master/html-proofer.gemspec

I checked and the issue is not there in version 1.1.4, which seems to download all the files in the repository, not just the bin and lib directories. As a result, the issue may stem from 88f6572.

Thank you for writing the gem - it has helped me find many interesting link errors.

@gjtorikian
Copy link
Owner

Ughhhhhh It's definitely from 88f6572. Reverting and shipping another bugfix update. Thanks!

@gjtorikian
Copy link
Owner

Done: 3cd4052

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

2 participants