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

Review pkp-docs README local preview instructions #1074

Closed
amandafrench opened this issue Mar 20, 2023 · 2 comments
Closed

Review pkp-docs README local preview instructions #1074

amandafrench opened this issue Mar 20, 2023 · 2 comments

Comments

@amandafrench
Copy link
Contributor

The README on this repository gives instructions for setting up a local docs preview, but I haven't been able to get it to work, possibly just because I am not sure of the localhost address for the preview. The Usage section reads


[Install Ruby 2.1.0 or higher](https://www.ruby-lang.org/en/documentation/installation/) and install the bundler gem.

gem install bundler

Access the pkp-docs root folder and install Jekyll to build or serve the site.

bundle install

Serve the site locally.

bundle exec jekyll serve

I've installed Ruby, bundler, and Jekyll. The messages I get when I run bundle exec jekyll serve are as follows. Could be that I shouldn't have installed Ruby on my M1 Mac using homebrew?

Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Configuration file: /Users/amandafrench/Websites/pkp-docs/_config.yml
            Source: /Users/amandafrench/Websites/pkp-docs
       Destination: /Users/amandafrench/Websites/pkp-docs/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Liquid Exception: undefined method `tainted?' for "Introduction":String in /Users/amandafrench/Websites/pkp-docs/_layouts/book.html
                    ------------------------------------------------
      Jekyll 4.1.1   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
/opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/variable.rb:124:in `taint_check': undefined method `tainted?' for "Introduction":String (NoMethodError)

      return unless obj.tainted?
                       ^^^^^^^^^
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/variable.rb:89:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:80:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:39:in `block (3 levels) in render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:59:in `measure_counts'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:38:in `block (2 levels) in render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:63:in `measure_bytes'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:37:in `block in render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:70:in `measure_time'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:36:in `render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/inclusion.rb:16:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/tags/include.rb:212:in `block in render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/context.rb:123:in `stack'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/tags/include.rb:210:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:103:in `render_node_to_output'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/block_body.rb:91:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:208:in `block in render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:242:in `with_profiling'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:207:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/liquid-4.0.3/lib/liquid/template.rb:220:in `render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:39:in `block (3 levels) in render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:59:in `measure_counts'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:38:in `block (2 levels) in render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:63:in `measure_bytes'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:37:in `block in render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:70:in `measure_time'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/liquid_renderer/file.rb:36:in `render!'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/renderer.rb:127:in `render_liquid'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/renderer.rb:190:in `render_layout'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/renderer.rb:159:in `place_in_layouts'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/renderer.rb:89:in `render_document'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/renderer.rb:63:in `run'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/site.rb:532:in `render_regenerated'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/site.rb:524:in `block in render_pages'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/site.rb:523:in `each'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/site.rb:523:in `render_pages'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/site.rb:208:in `render'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/site.rb:80:in `process'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:28:in `process_site'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/commands/build.rb:65:in `build'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/commands/build.rb:36:in `process'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `each'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/jekyll-4.1.1/exe/jekyll:15:in `<top (required)>'
	from /opt/homebrew/lib/ruby/gems/3.2.0/bin/jekyll:25:in `load'
	from /opt/homebrew/lib/ruby/gems/3.2.0/bin/jekyll:25:in `<top (required)>'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `load'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:63:in `kernel_load'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli/exec.rb:28:in `run'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli.rb:476:in `exec'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor.rb:399:in `dispatch'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli.rb:30:in `dispatch'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/base.rb:476:in `start'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/cli.rb:24:in `start'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/exe/bundle:46:in `block in <top (required)>'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/lib/bundler/friendly_errors.rb:123:in `with_friendly_errors'
	from /opt/homebrew/lib/ruby/gems/3.2.0/gems/bundler-2.1.4/exe/bundle:34:in `<top (required)>'
	from /opt/homebrew/lib/ruby/gems/3.2.0/bin/bundle:25:in `load'
	from /opt/homebrew/lib/ruby/gems/3.2.0/bin/bundle:25:in `<main>'

@NateWr
Copy link
Contributor

NateWr commented Mar 21, 2023

Hi @amandafrench, sorry for the hassle. To be honest, I'm not that familiar with ruby so I always have trouble debugging bundle issues like this. It looks like the error message you are getting is because a dependency is not compatible with Ruby 3.2:

github/pages-gem#859

The proper fix would be to correct the dependencies, but I'm hesitant to tinker with this until we have a proper resource to manage the docs hub. That's because a) it's not a tech stack our team very familiar with and b) @AhemNason is the only one on the team that builds the docs hub for production and I don't want to make a change that forces him into hours of debugging his system.

In my experience, the version of Ruby that's being used seems to make a big difference. In the past I've used rvm to jump between Ruby versions. Here's the version I'm running now:

$ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]

I also noticed that I have local changes in my Gemfile and Gemfile.lock files:

diff --git a/Gemfile b/Gemfile
index 4609b002e..e67f0d866 100644
--- a/Gemfile
+++ b/Gemfile
@@ -8,3 +8,5 @@ group :jekyll_plugins do
 	gem 'jekyll-readme-index'
 	gem 'jekyll-sitemap'
 end
+
+gem "webrick", "~> 1.7"
diff --git a/Gemfile.lock b/Gemfile.lock
index b62839875..df37c7a80 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -68,6 +68,7 @@ GEM
     terminal-table (1.8.0)
       unicode-display_width (~> 1.1, >= 1.1.1)
     unicode-display_width (1.8.0)
+    webrick (1.7.0)
 
 PLATFORMS
   ruby
@@ -80,6 +81,7 @@ DEPENDENCIES
   jekyll-seo-tag
   jekyll-sitemap
   jekyll-titles-from-headings
+  webrick (~> 1.7)
 
 BUNDLED WITH
    2.1.4

No idea why these are necessary (or why Mike doesn't need them to build). Hope that helps a little bit.

@amandafrench
Copy link
Contributor Author

That helps a lot, @NateWr! I'll give that a try. And if it doesn't work I'll probably just resign myself to using the existing preview of the docs site or maybe finally installing the GitHub desktop client instead of doing everything from the Terminal.

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