ocamlverse.github.io
ocamlverse.github.io copied to clipboard
Running jekyll server locally
To run the jekyll server locally with Ruby v3, I needed to add gem 'webrick', '~> 1.7'
to the Gemfile
.
Note: If you are using Ruby 3.0 and Jekyll 4.2.x or older, you will need to add the webrick gem to your project's Gemfile prior to running bundle install. (source)
Adding this to the Gemfile lets you run the jekyll server locally both on v2 and v3 (I tested on Ruby versions 2.7.2 and 3.1.2).
If you would like, I could open a pull request for this.
One other suggestion: it may be a good idea to link somewhere about how to set up a local test version of the ocamlverse webpage for new contributors.
This github page has some instructions on how to do it, so it may be enough to link that page somewhere on the contributing page.
Feel free to open a PR for this requirement. So long as ocamlverse keeps running as is, I'm happy to keep up with the toolchain.
In general, I don't really care about running ocamlverse locally, but if you want to contribute a page about it (maybe under 'About OCamlverse', which needs to be updated anyway since it's no longer a "new" resource), I'd be happy to add it. You could put a Meta
tag on it so it shows up on the left menu under Meta.
Sure I will put something together in a few days.
Question...if you aren't running the site locally, do you have another way to preview changes?
I just update on github and look at the changes, fixing as needed. The formatting is pretty constant at this point, so it's just content that changes.
To run the jekyll server locally with Ruby v3, I needed to add gem 'webrick', '~> 1.7' to the Gemfile.
Might be better to just do a bundle update
(it's necessary from time to time). I agree it'd be nice to document how people to use Jekyll locally, or at the very least mention that the site is built using Jekyll and point to the official docs.
That could be the case that only a bundle update
is needed. The tip to explicitly add webrick to the Gemfile was from the GitHub docs, and it did work for me once I added it, but I don't remember if I tried just a bundle update
first.
Eventually I plan to open a pull request for this, but I won't get to it for a couple weeks, so if anyone else wants to first, feel free :)
I've added some docs here https://github.com/OCamlverse/ocamlverse.github.io/pull/151
Webrick is needed in Ruby 3 because it was removed from the standard library (see https://bugs.ruby-lang.org/issues/17303). I can add a note about it later. I'm still using Ruby 2.7 myself, as at work we haven't migrated to 3.0+ yet.
Seems like #151 and #158 cover everything in my original issue.