Another Way to Run Jekyll on Windows 10

Recently, preparations were made to continue writing blogs and the Jekyll environment needs to be installed.

There are Mac and PCs on hand, and given that PCs are attached to work, it is important to have a Jekyll environment under Windows.

According to the Jekyll network, it was to install Ruby Insteller. However, Ruby Installer was itself based on MSYS2, and my PC had installed MSYS2, and decided not to make another set, so it was decided to install Ruby and Jekyll on MSYS2.

MSYS2 is similar to Cygwin (which is actually a Cygwin branch) and allows users to use UNIX packages under Windows. The concept is presented here:

MSYS2 is a collection of Pacman and MinGW-w64.

We use MSYS2 in China, and we better set up a mirror image of the country.Big mirror for middle school.But at the moment, they have a problem with their stuff, so they have to change it.Qinghua's mirror. Unfortunately, I'm actually close to middle school.

Sets the mirror image as described on the page and executes:

pacman -Syu

At the final hint to close MSYS2, the X of the dot window closes and then runs at the MMYS2 installation directory.bat. Then open MSYS2 and do an update:

pacman -Su

And then I installed a series of software, and here I am:

pacman -S vim git base-devel mingw-w64-x86_64-toolchain mingw-w64-x86_64-ruby mingw-w64-x86_64-ruby-native-package-installer

The reason for using mingw64-w64-x86_64-ruby instead of msys/ruby was because I tried it first, and there was always a library that couldn't be compiled when Jekyll was installed in Gem. I'm not going to do this. Let's do this. We'll find a solution later.

After this version of Ruby is installed,shell typeSetming as mingw64 to MMYS2 environment, i.e. from “MSYS2 MinGW 64-bit” instead of “MSYS2 MSYS”. The former would add/mingw64/bin to PATH, while the version of Ruby would be installed in/mingw64/bin.

And then I'm gonna put Bundler and Jekyll in Gem:

gem install bundler jekyll

I have an old blog that I haven't written for a long time, and I need to upgrade it, so I'm in the blog's directory, and I'm doing it:

bundle update

The upgrade of Gem was said to be a very dramatic thing, and Ruby programmers were often able to upgrade individual Gems at a time, and to do so at a one-time round-the-book update, which could be problematic. And I've done this over and over again between the bookle install and the bookle update. I'll check it out.The difference between a bunch of kids and a bunch of kids..

Once the upgrade is complete, you can continue.I'm writing a blog on Jekyll.Got it.

PS:

I've been looking at Jekyll for a little study.Jekyll Step by Step Tutorial. And in the first step, it's using jekyll service to run Jekyll, which is a little different from the way we usually use the bundle exec jekyll service. In fact, there's an explanation for the tenth step.What's going on?. I'm not very familiar with Ruby, and I'm sure a lot of people who use Jekyll. Anyway, Bundler's probably a tool to deal with different versions of the same Gem that were quoted at the same time, and we just remember to use it.

Moreover, while the title of this article is Windows 10, it does not mean that it does not apply to the previous Windows version, which I have not tried.