Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

Commit

Permalink
Updated the Build using Jekyll section.
Browse files Browse the repository at this point in the history
  • Loading branch information
dshevtsov committed May 9, 2018
1 parent 6351bfd commit 68e26da
Showing 1 changed file with 44 additions and 28 deletions.
72 changes: 44 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,52 +14,68 @@ You can build this site locally in the following ways:

## Build using Jekyll

For local builds, you need to install [Ruby](https://www.ruby-lang.org) version manager and [Bundler](http://bundler.io/).
For local builds, you need to install Ruby 2.4 or later.

This comment has been minimized.

Copy link
@jeff-matthews

jeff-matthews May 30, 2018

Contributor

@dshevtsov, I think we should be encouraging users to use a Ruby version manager like rbenv or rvm to install Ruby. Using a version manager makes it easier to maintain Ruby. Several people on the team are also using Ruby version managers, so if it'll be difficult to help others troubleshoot issues if they're not also using a version manager.


### To prepare your MacOS environment:
1. Install Homebrew. See the [Homebrew site](https://brew.sh) for instructions.
1. Use Homebrew to install a Ruby version manager.
To check the Ruby version on your environment, run in your terminal:

```
$ brew install rbenv ruby-build
```
```shell
$ ruby -v
```

1. Add rbenv to bash so that it loads every time you open a terminal.
### Install the latest Ruby (if the Ruby version is less than 2.4)

```
$ echo 'if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi' >> ~/.bash_profile
**MacOS users**

1. Install Homebrew. See the [Homebrew site](https://brew.sh) for instructions.
1. Use Homebrew to install the latest stable version of Ruby:

```shell
$ brew install ruby
```

1. Source your `.bash_profile` file.
**Unix, Windows and other OS users**

```
$ source ~/.bash_profile
```
See the [Ruby site](https://www.ruby-lang.org/en/documentation/installation) for instructions.

1. Install a specific version of Ruby.
### Install Bundler

```
$ rbenv install 2.4.x
$ rbenv global 2.4.x
$ ruby -v
```
Install the [Bundler](http://bundler.io/) gem, which helps with Ruby dependencies:

1. Install the Bundler gem, which helps with Ruby dependencies.
```
$ gem install bundler
```

```
$ gem install bundler
Once you have completed preparing your environment, you can build locally and review the site in your browser.

### To build locally:

#### Using rake

[rake](https://github.com/ruby/rake) is a native Ruby tool that helps to automate tasks.

1. Run the rake task that installs all required dependencies and starts the [Jekyll](https://jekyllrb.com/) server:

```shell
$ rake preview
```

1. Run `bundle install` the first time you are in the `devdocs` directory or when you need to pick up theme changes.
1. Press `Ctrl+C` in the serve terminal to stop the server.

### To build locally:
Once you have completed preparing your environment, you can build locally and review the site in your browser.
If rake fails on your environment, generate the preview [using jekyll](#using-jekyll).

1. Run the serve command.
#### Using jekyll

1. The first time you are at the `devdocs` directory or when you need to pick up changes in `Gemfile.lock` dependencies (for example, theme changes), run:

```
$ bundle exec jekyll serve --incremental
$ bundle install
```

2. To generate the local preview, run:

```
$ bundle exec jekyll serve --incremental
Configuration file: /Users/username/Github/devdocs/_config.yml
Source: /Users/username/Github/devdocs
Destination: /Users/username/Github/devdocs/_site
Expand Down

0 comments on commit 68e26da

Please sign in to comment.