Skip to content

Gems without nokogiri cannot compile web docs #259

Description

@info-rchitect

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions