github / pages-gem

A simple Ruby Gem to bootstrap dependencies for setting up and maintaining a local Jekyll environment in sync with GitHub Pages
http://pages.github.com
MIT License
1.82k stars 349 forks source link

Liquid version on M1 Mac #870

Closed StuMaitland closed 1 year ago

StuMaitland commented 1 year ago

This issue affects

Building sites locally

What did you do (e.g., steps to reproduce)

Trying to follow instructions to install github-pages locally. Using ruby 3.2, macOS Monterey

On running bundle exec jekyll serve I get the following error

 Liquid Exception: undefined method 'untaint' for "Welcome to Jekyll!":String in /_layouts/post.html`

Looking at Jekyll issue tracker, this is an issue with Liquid, fixed in v 4.0.4: https://github.com/jekyll/jekyll/issues/9233 When I add this to the gemfile (gem "liquid", "~> 4.0.4"), I get a version conflict:

Could not find compatible versions

Because github-pages >= 203, < 228 depends on liquid = 4.0.3
  and Gemfile depends on liquid ~> 4.0.4,
  github-pages >= 203, < 228 is forbidden.
So, because Gemfile depends on github-pages ~> 227,
  version solving has failed.

And when I try requiring github-pages ~> 228, it seems to be incompatible with M1 silicon due to a dependency:

Could not find gem 'http_parser.rb (= 0.8.0)' with platform 'x86_64-darwin-21' in rubygems repository https://rubygems.org/ or installed locally.

The source contains the following gems matching 'http_parser.rb (= 0.8.0)':
  * http_parser.rb-0.8.0
parkr commented 1 year ago

This is because you're using Ruby 3.2. A fix is in the works: https://github.com/github/pages-gem/pull/860

parkr commented 1 year ago

Upgrade to github-pages gem to v228. (https://github.com/github/pages-gem/pull/867)

StuMaitland commented 1 year ago

Thanks this fixes it!