Website works fine on local server but fails in GitHub pages

333 Views Asked by At

I have a Jekyll website that also uses paginate-v2. I was deploying it on GitHub pages, and it was working fine, until I added pagination.

You can get the code on https://github.com/divyessh/tennis-events/

And here is the last deployment without pagination:

https://divyessh.github.io/tennis-events/

4

There are 4 best solutions below

0
On

I am also facing the same issue after some research I have a solution if GitHub pages do not support Paginate-V2, if you want to use that then you need to integrate with the third-party cms like I am using site leaf which will allows you to utilize the functionality in v2

https://github.com/DevlopersField/jekyll-paginate-v2

for more https://learn.siteleaf.com/themes/jekyll-plugins/

2
On

Maybe github pages uses a custom ruby version. If you get that information, docker could help you to replicate the exact github pages infrastructure in your localhost.

2
On

Please see if running adding webrick gem to your project resolves the GitHub pages build error.

Here are the following steps I did to make your website work locally using jekyll serve.

  1. Cloned git repo at commit 425bb79b99deb4b7a00d2a13b4fd8c857a22ca49.
  2. bundle install in tennis-events directory
  3. bundle exec jekyll serve
  4. Observed this error /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
  5. Found this jekyll issue #8523
  6. Ran bundle add webrick per issue#8523 comment
  7. bundle exec jekyll serve
  8. Observed website rendering at http://localhost:4000/tennis-events/ jekyll serve screenshot
1
On

Paginate-V2 is not listed as supported by Github Pages, and is likely not supported. However judging by your use case you should be able to use the supported version of Paginate.