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

Gems without nokogiri cannot compile web docs #259

Closed
info-rchitect opened this Issue Apr 25, 2018 · 8 comments

Comments

Projects
None yet
3 participants
@info-rchitect
Member

info-rchitect commented Apr 25, 2018

Hi,

Here is the error:

Loading site data\u2026 
Captain! We\u2019ve been hit!

Message:

LoadError: cannot load such file -- nokogiri
Make sure the gem is added to Gemfile and run `bundle install`.

Compilation stack:

  (empty)

Stack trace:

  0. lib/bootstrap_filter.rb:1:in `require'
  1. lib/bootstrap_filter.rb:1:in `<main>'
  2. /home/bcaqueli/.origen/gems/ruby/2.3.0/gems/nanoc-3.8.0/lib/nanoc/base/source_data/code_snippet.rb:34:in `eval'

I did a recursive grep and the only difference between gems that can compile web docs and those that cannot is the lack of nokogiri being in the Gemfile.lock.

# gem that can compile webdocs
,yserver $ grep -ri nokogiri *
Gemfile.lock:      nokogiri (>= 1.4.1)
Gemfile.lock:    nokogiri (1.8.2)
Gemfile.lock:      nokogiri (~> 1)
lbin/nokogiri:# The application 'nokogiri' is installed as part of a gem, and
lbin/nokogiri:load Gem.bin_path("nokogiri", "nokogiri")
web/lib/bootstrap_filter.rb:require 'nokogiri'
web/lib/bootstrap_filter.rb:    doc = Nokogiri::HTML.fragment(content)
web/lib/bootstrap_filter.rb:    Nokogiri::HTML(html).css("div")
web/lib/codeblocks_filter.rb:require 'nokogiri'
web/lib/codeblocks_filter.rb:    doc = Nokogiri::HTML.fragment(content)
web/lib/search_filter.rb:require 'nokogiri'
web/lib/search_filter.rb:    doc = Nokogiri::HTML(content)

# gem that cannot compile web docs
pmyserver $ grep -ri nokogiri *
lbin/nokogiri:# The application 'nokogiri' is installed as part of a gem, and
lbin/nokogiri:load Gem.bin_path("nokogiri", "nokogiri")
web/lib/bootstrap_filter.rb:require 'nokogiri'
web/lib/bootstrap_filter.rb:    doc = Nokogiri::HTML.fragment(content)
web/lib/bootstrap_filter.rb:    Nokogiri::HTML(html).css("div")
web/lib/codeblocks_filter.rb:require 'nokogiri'
web/lib/codeblocks_filter.rb:    doc = Nokogiri::HTML.fragment(content)
web/lib/search_filter.rb:require 'nokogiri'
web/lib/search_filter.rb:    doc = Nokogiri::HTML(content)
web/crash.log:LoadError: cannot load such file -- nokogiri

Seems like we need some new Gemfile mode that enables nokogiri during web compile.  Anyone know how to do this?

thx
@coreyeng

This comment has been minimized.

Member

coreyeng commented Apr 25, 2018

You should be able to bring in nokogiri yourself and those gems will work. I had a similar problem with my IAR plugin when I updated Origen versions and I included nokogiri in the application Gemfile to fix it. Origen doc helpers probably needs to be updated to pull in nokogiri itself since Origen no longer will. Or, we add nokogiri back to Origen's gemspec with just open conditions (no min/max version).

@coreyeng

This comment has been minimized.

Member

coreyeng commented Apr 25, 2018

Seems that if Origen doesn't actually need it though, just other things that depend on Origen need Nokogiri, then those other things should be pulling it in, not Origen itself.

@info-rchitect

This comment has been minimized.

Member

info-rchitect commented Apr 25, 2018

@coreyeng I don't think it is the gems responsibility because the web docs use some gem themselves right? Shouldn't that gem handle making sure it has nokogiri?

@coreyeng

This comment has been minimized.

Member

coreyeng commented Apr 25, 2018

Yes, you are correct. I was thinking the web filter stuff was in origen_doc_helpers, in which case, origen_doc_helpers should bring in Nokogiri. Doing a search on the origen repo, specs are also reliant on Nokogiri, so we should be bringing in Nokogiri in Origen (or ship this stuff out to other/separate plugins who will require nokogiri).

@ginty

This comment has been minimized.

Member

ginty commented Apr 27, 2018

I've noticed this too, it seems that Origen did actually depend on nokogiri.

I think we should add nokogiri >= 1.7.2 into Origen's gemspec

@coreyeng

This comment has been minimized.

Member

coreyeng commented May 4, 2018

@info-rchitect okay to close this issue?

@coreyeng

This comment has been minimized.

Member

coreyeng commented May 4, 2018

Should be fixed in 0.33.1

@info-rchitect

This comment has been minimized.

Member

info-rchitect commented May 4, 2018

@coreyeng yep

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment