Jekyll is a static web site Generation tool. It allows users to create static pages using HTML, markdown, or textile, and then runs through the template engine Liquid (Liquid templating engine).
Original link: Setup Jekyll on Windows
At present, there are many Jekyll installation methods on the Internet, most similar, in order to facilitate more people to prepare to learn Jekyll, special translation is as follows:
are divided into the following important steps
- Install Ruby
- Installing DevKit
- Installing Jekyll
- Installing Pygments
- Install Python
- Install ' Easy Install '
- Installing Pygments
- Start Jekyll
- Fault diagnosis
Install Ruby
Go to http://rubyinstaller.org/downloads/
In the "Rubyinstallers" section, select a version and click Download.
For example, Ruby 2.0.0-p451 (x64) is suitable for the Ruby 2.0.0 x64 installation package on a 64-bit Windows machine.
Installing through the installation package
- It is best to keep the default path
C:\Ruby200-x64
because the installation package explicitly says "Please do not use a folder with spaces (such as program Files)."
- Tick "Add Ruby executables to your path" so that the execution program is automatically added to the path to avoid unnecessary headaches.
Open a command prompt and enter the following command to detect whether Ruby installed successfully.
Ruby-v
Output Example:
Ruby 2.0.0p451 (2014-02-24) [X64-mingw32]
Installing DevKit
DevKit is a toolbox on Windows that helps simplify installation and use Ruby/C + + extensions such as Rdiscount and Redcloth. Detailed installation instructions can be read on the wiki page of the program .
Go to http://rubyinstaller.org/downloads/ again
Download the DevKit installation package that corresponds to the system and Ruby version. For example, Devkit-mingw64-64-4.7.2-20130224-1432-sfx.exe applies to Ruby 2.0.0 x64 on 64-bit Windows systems.
Here's how to choose the correct DevKit version:
Ruby 1.8.6 to 1.9.3: DevKit tdm-32-4.5.2
Ruby 2.0.0: DevKit mingw64-32-4.7.2
Ruby 2.0.0 x64: DevKit mingw64-64-4.7.2
Run the installation package and unzip it to a folder, such as C:\DevKit
The Config.yml file is created by initialization. In the Command Line window, enter the following command:
CD "C:\DevKit"
Ruby DK.RB Init
Notepad config.yml
In the Notepad window that opens, add a new line at the end - C:\Ruby200-x64
, save the file, and exit.
Back in the Command Line window, review (not required) and install.
Ruby DK.RB Review
Ruby Dk.rb Install
Installing Jekyll
Make sure the gem is properly installed
Gem-v
Output Example:
2.0.14
Installing the Jekyll Gem
Gem Install Jekyll
Installing Pygments
The default syntax highlighting plugin in Jekyll is pygments. It needs to install Python and _config.yml
highlighter
Set the value in the Web site's configuration file pygments
.
Not long ago, Jekyll also added another highlight engine named Rouge, which is a native Ruby program without the need to use Python, although it is not as good as pygments support for so many languages at the moment. For more information please click here to pay attention.
Install Python
- Go to http://www.python.org/download/
- Download the appropriate Python Windows Installer package, such as Python 2.7.6 windows Installer. Please note that Python 2 may be more appropriate because temporarily Python 3 may not work correctly.
- Installation
- Add the installation path (for example: C:\Python27) to path. (How do I do this? See troubleshooting #1)
Verify that the Python installation is successful
Python–v
Output Example:
Python 2.7.6
Install ' Easy Install '
- Browse https://pypi.python.org/pypi/setuptools#installation-instructions To see the detailed installation guide.
For Windows 7 machines, download ez_setup.py and save, for example, to C:\
. Then run this file from the command line using Python:
Python "C:\ez_setup.py"
- Add a ' Python Scripts ' path (for example: C:\Python27\Scripts) to Path
Installing Pygments
Make sure the Easy_install is properly installed
Easy_install--version
Output Example:
Setuptools 3.1
Use "Easy_install" to install Pygments
Easy_install pygments
Start Jekyll
Follow the official Jekyll Quick Start manual steps, a new Jekyll blog can be built and browsed in localhost:4000.
Jekyll New MyBlog
CD MyBlog
Jekyll serve
Fault diagnosis
Error message:
“python” is not recognized as an internal or external command, operable program or batch file.
other things : "Python" here can also be "Ruby", "Gem" or "Easy_install" and so on.
possible cause : The program may not be properly installed or not successfully set in PATH.
Try the solution : Make sure the program is properly installed. Then manually add it to PATH, please refer to the following steps [1].
- Hold the Win key and press Pause
- Click Advanced System Settings
- Click Environment Variables
- Will C:\python27 added to the end of the Path variable
- Restart command line
-
Error message:
error:error installing jekyll:ERROR:Failed to build gem native extension. C:/Program Files/ruby/ruby200-x64/bin/ruby.exe "extconf.rbcreating Makefilemake generating Stemmer-x64-mingw32.defcompiling porter.c...make install/usr/bin/install-c-M 0755 stemmer.so C:/Program Files/Ruby/ Ruby200-x64/lib/ruby/gems/2.0.0/gems/fast-stemmer-1.0.2/li/usr/bin/install:target ' Files/Ruby/Ruby200-x64/lib/ Ruby/gems/2.0.0/gems/fast-stemmer-1.0.2/lib ' is not a directorymake: * * * [install-so] Error 1
Possible cause : Ruby is installed in a path that contains spaces.
Try Solution : Reinstall Ruby, do not use a path with spaces this time, or choose to use the default path directly.
Error message:
Generating... Liquid Exception: No such file or directory - python c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/pygments.rb-0.4.2/lib/pygments/mentos.py in 2013-04-22-yizeng-hello-world.md
possible causes : Pygments failed to install correctly or the PATH setting is not yet in effect.
Try the solution : First make sure that the pygments is installed successfully and that Python's PATH setting does not contain spaces and the last extra slash. Then restart the command line. If it still fails, try logging out and logging back in to Windows. Even use the ultimate solution to restart your computer.
Error message:
Generating... Liquid Exception: No such file or directory - /bin/sh in _posts/2013-04-22-yizeng-hello-world.md
possible causes : compatibility issues with the PYGMENTS.RB 0.5.1/0.5.2 version.
Try the solution : Reduce the version of the Pygments.rb gem from 0.5.1/0.5.2 to 0.5.0.
Gem Uninstall pygments.rb–version ' =0.5.2 '
Gem Install pygments.rb–version 0.5.0
-
Error message:
c:/ruby200-x64/lib/ruby/2.0.0/rubygems/dependency.rb:296:in ' to_specs ': Could not find ' Pygments.rb ' (~> 0.4.2)-Did find: [pygments.rb-0.5.0] (gem::loaderror) from C:/ruby200-x64/lib/ruby/2.0.0/rubygems /specification.rb:1196:in ' block in Activate_dependencies ' from c:/ruby200-x64/lib/ruby/2.0.0/rubygems/ Specification.rb:1185:in ' Each ' from C:/ruby200-x64/lib/ruby/2.0.0/rubygems/specification.rb:1185:in ' Activate_ Dependencies ' from c:/ruby200-x64/lib/ruby/2.0.0/rubygems/specification.rb:1167:in ' activate ' from c:/ruby200-x64/ Lib/ruby/2.0.0/rubygems/core_ext/kernel_gem.rb:48:in ' Gem ' from C:/ruby200-x64/bin/jekyll:22:in ' <main> '
possible cause : As described in the error message, PYGMENTS.RB 0.4.2 is not found and only pygments.rb 0.5.0 is found. (This issue appears in the Jekyll version of this first draft, the current version should be fixed)
try Solution : Downgrade the version of the pygments.rb gem to 0.4.2
Gem UN Install pygments.rb–version "=0.5.0"
Gem install pygments.rb–version "=0.4.2"
-
Error message:
generating ... You is missing a library required for Markdown. Please run:$ [sudo] gem install rdiscountconversion Error:there is an error converting ' _posts/2013-04-22-yizeng-hello-w Orld.md/#excerpt '. Error:your SITE COULD not being BUILT:------------------------------------Missing dependency:rdiscount
possible causes : Dependent package &NBSP; rdiscount
not found. The most likely cause of this problem is that the site uses rdiscount As the Markdown engine, rather than the Jekyll default engine, it needs to be installed manually.
try Solution :
Gem install Rdiscount
-
Error message:
c:/ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in ' Require ': Cannot load such file--WDM (Loaderror) from c:/ruby200-x64/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/ Kernel_require.rb:55:in ' require ' from C:/RUBY200-X64/LIB/RUBY/GEMS/2.0.0/GEMS/LISTEN-1.3.1/LIB/LISTEN/ADAPTER.RB : 207:in ' Load_dependent_adapter ' from c:/ruby200-x64/lib/ruby/gems/2.0.0/gems/listen-1.3.1/lib/listen/adapters/ Windows.rb:33:in ' load_dependent_adapter ' ...
Possible cause : &NBSP; WDM
gem was not installed. Because Jekyll only officially supports the *nix system, windows Directory monitor is not automatically installed as a dependent package.
try Solution :
Gem install WDM
8. In order to allow the site to function properly, it is necessary to delete the files in the _post folder (there should be a xxxx-xx-xx-welcome-to- Jekyll.markdown file), because this file is used inside the syntax highlighting plugin (also do not delete, you can modify the configuration file to disable the syntax highlighting plug-in, that is, to modify the root directory _config.yml in the Pygments:true is false. ), this need to install additional, no longer within the scope of this article, do not delete will cause the static page generated problems, due to limited time this article does not mention this issue.
Install Jekyll on Windows