parent
25ccfd5b49
commit
ebac932f10
|
|
@ -11,18 +11,27 @@ It's good practice to have a [Gemfile](/docs/ruby-101/#gemfile) for your site.
|
||||||
This ensures the version of Jekyll and other gems remains consistent across
|
This ensures the version of Jekyll and other gems remains consistent across
|
||||||
different environments.
|
different environments.
|
||||||
|
|
||||||
Create `Gemfile` in the root with the following:
|
Create a `Gemfile` in the root.
|
||||||
|
The file should be called 'Gemfile' and should *not* have any extension.
|
||||||
|
You can create a Gemfile with bundler and then add the `jekyll` gem:
|
||||||
|
|
||||||
```ruby
|
```sh
|
||||||
source 'https://rubygems.org'
|
bundle init
|
||||||
|
bundle add jekyll
|
||||||
gem 'jekyll'
|
|
||||||
```
|
```
|
||||||
|
|
||||||
Then run `bundle install` in your terminal. This installs the gems and
|
Your file should look something like:
|
||||||
creates `Gemfile.lock` which locks the current gem versions for a future
|
|
||||||
`bundle install`. If you ever want to update your gem versions you can run
|
```ruby
|
||||||
`bundle update`.
|
# frozen_string_literal: true
|
||||||
|
source "https://rubygems.org"
|
||||||
|
|
||||||
|
gem "jekyll"
|
||||||
|
```
|
||||||
|
|
||||||
|
bundler installs the gems and creates a `Gemfile.lock` which locks the current
|
||||||
|
gem versions for a future `bundle install`. If you ever want to update your gem
|
||||||
|
versions you can run `bundle update`.
|
||||||
|
|
||||||
When using a `Gemfile`, you'll run commands like `jekyll serve` with
|
When using a `Gemfile`, you'll run commands like `jekyll serve` with
|
||||||
`bundle exec` prefixed. So the full command is:
|
`bundle exec` prefixed. So the full command is:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue