updated install instructions

This commit is contained in:
tomjohnson1492
2016-05-30 16:53:12 -07:00
parent fc1efd12b8
commit 1f4bf78619
14 changed files with 216 additions and 61 deletions

View File

@ -49,6 +49,7 @@ RedCloth = 4.2.9
rouge = 1.10.1
terminal-table ~> 1.
```
See how Bundler retrieved version 3.0.3 of the jekyll gem, even though (as of this writing) the latest version of the jekyll gem is 3.1.2? That's because github-pages is only compatible up to jekyll 3.0.3. Bundler handles all of this dependency and version compatibility for you.
Trying to keep track of which gems and versions are appropriate for your project can be a nightmare. This is the problem Bundler solves. As explained on [Bundler.io](http://bundler.io/):

View File

@ -74,9 +74,23 @@ Now Ruby and Rubygems are installed under your username, so these directories ar
Note that if you don't see these paths, try restarting your computer or try installing rbenv, which is a Ruby version management tool. If you still have issues getting a writeable version of Ruby, you need to resolve them before installing Bundler.
<h2 id="bundler">Install Bundler</h2>
<h2 id="bundler">Install the Jekyll gem</h2>
At this point you should have a writeable version of Ruby on your machine. Now you need to get all the gems (or Ruby plugins) that you need for your Jekyll project. [Bundler](http://bundler.io/) is a package manager for RubyGems.
At this point you should have a writeable version of Ruby and Rubygem on your machine.
Now use `gem` to install Jekyll:
```
gem install jekyll
```
You can now use Jekyll to create new Jekyll sites following the quick-start instructions on [Jekyllrb.com](http://jekyllrb.com).
## Installing dependencies through Bundler
Some Jekyll themes will require certain Ruby gem dependencies. These dependencies are stored in something called a Gemfile, which is packaged with the Jekyll theme. You can install these dependencies through Bundler. (Although you don't need to install Bundler for this Documentation theme, it's a good idea to do so.)
[Bundler](http://bundler.io/) is a package manager for RubyGems. You can use it to get all the gems (or Ruby plugins) that you need for your Jekyll project.
You install Bundler by using the gem command with RubyGems:
@ -86,37 +100,12 @@ gem install bundler
If you're prompted to switch to superuser mode (`sudo`) to get the correct permissions to install Bundler in that directory, avoid doing this. All other applications that need to use Bundler will likely not have the needed permissions to run.
## Customize the Gemfile
Bundler goes out and retreives all the gems that are specified in a Jekyll project's Gemfile. If you have a gem that depends on other gems to work, Bundler will go out and retrieve all of the dependencies as well. (To learn more about Bundler, see {{site.data.urls.mydoc_about_ruby_gems_etc.link}}.
Bundler goes out and retreives all the gems that are specified in your project's Gemfile. If you have a gem that depends on other gems to work, Bundler will go out and retrieve all of the dependencies as well. (To learn more about Bundler, see {{site.data.urls.mydoc_about_ruby_gems_etc.link}}.
The vanilla Jekyll site you create through `jekyll new my-awesome-site` doesn't have a Gemfile, but many other themes (including the Documentation theme for Jekyll) do have a Gemfile.
Open the Gemfile (in any text editor) in the Jekyll doc theme project:
## Serve the Jekyll Documentation theme
```
open Gemfile
```
The theme's gemfile looks as follows:
```
# A sample Gemfile
source "https://rubygems.org"
# gem "rails"
gem 'github-pages'
gem 'jekyll'
```
If you're publishing on Github Pages, leave the `github-pages` gem there. But if not, remove `github-pages` because Github sometimes has dependencies that conflict with the latest versions of the Jekyll gem and Kramdown, which can be frustrating.
Use Bundler to install all the needed Ruby gems:
```
bundle install
```
Now run Jekyll serve to build the theme:
```
jekyll serve
```
1. Browse to the directory where you downloaded the Documentation theme for Jekyll.
2. Type `jekyll serve`
3. Go to the preview address in the browser. (Make sure you include the `/` at the end.)

View File

@ -5,7 +5,7 @@ keywords: jekyll on windows, pc, ruby, ruby dev kit
sidebar: mydoc_sidebar
---
{{site.data.alerts.tip}} For a better terminal emulator on Windows, download <a href="https://sourceforge.net/projects/console/">Console</a>. This terminal allows you to create tabs and gives you more functionality. {{site.data.alerts.end}}
{{site.data.alerts.tip}} For a better terminal emulator on Windows, use [Git Bash](https://git-for-windows.github.io/). Git Bash gives you Linux-like control on Windows. {{site.data.alerts.end}}
## Install Ruby
@ -32,26 +32,39 @@ Some extensions Jekyll uses require you to natively build the code using the Rub
If you get stuck, see the [official instructions for installing Ruby Dev Kit](https://github.com/oneclick/rubyinstaller/wiki/Development-Kit).
<h2 id="bundler">Install the Jekyll gem</h2>
At this point you should have Ruby and Rubygem on your machine.
Now use `gem` to install Jekyll:
```
gem install jekyll
```
You can now use Jekyll to create new Jekyll sites following the quick-start instructions on [Jekyllrb.com](http://jekyllrb.com).
## Installing dependencies through Bundler
Some Jekyll themes will require certain Ruby gem dependencies. These dependencies are stored in something called a Gemfile, which is packaged with the Jekyll theme. You can install these dependencies through Bundler. (Although you don't need to install Bundler for this Documentation theme, it's a good idea to do so.)
[Bundler](http://bundler.io/) is a package manager for RubyGems. You can use it to get all the gems (or Ruby plugins) that you need for your Jekyll project.
You install Bundler by using the gem command with RubyGems:
## Install Bundler
1. Using the command line, browse to the folder where you downloaded the Jekyll theme.
2. Delete the existing **Gemfile** and **Gemfile.lock** files:
```
del Gemfile
del Gemfile.lock
```
1. Install Bundler: `gem install bundler`
3. Initialize Bundler: `bundle init`
2. Initialize Bundler: `bundle init`
This will create a new Gemfile.
4. Open the Gemfile in a text editor.
3. Open the Gemfile in a text editor.
Typically you can open files from the Command Prompt by just typing the filename, but because Gemfile doesn't have a file extension, no program will automatically open it. You may need to use your File Explorer and browse to the directory, and then open the Gemfile in a text editor such as Notepad.
5. Remove the existing contents. Then paste in the following:
4. Remove the existing contents. Then paste in the following:
```
source "https://rubygems.org"
@ -61,20 +74,15 @@ If you get stuck, see the [official instructions for installing Ruby Dev Kit](ht
```
The [wdm gem](https://rubygems.org/gems/wdm/versions/0.1.1) allows for the polling of the directory and rebuilding of the Jekyll site when you make changes. This gem is needed for Windows users, not Mac users.
6. Save and close the file.
7. Type `bundle install`.
Bundle retrieves all the needed gems and gem dependencies and downloads them to your computer. At this time, Bundle also takes a snapshot of all the gems used in your project and creates a Gemfile.lock file to store this information.
## Serve the Jekyll site
## Serve the Jekyll Documentation theme
1. Browse to the jekyll theme directory.
1. Browse to the directory where you downloaded the Documentation theme for Jekyll.
2. Type `jekyll serve`
3. Go to the preview address in the browser. (Make sure you include the `/` at the end.)
Unfortunately, the Command Prompt doesn't allow you to easily copy and paste the URL, so you'll have to type it manually.
## Troubleshooting
Bundler retrieves the latest version of the jekyll gem that is compatible with the github-pages gem. Unfortunately, in my testing, I think that version of the jekyll gem has some issues with the kramdown gem. Later versions of the jekyll gem fix the kramdown compatibility issues. If you run into this issue, let me know (especially if you solved it).