# Cannot Build the site on the preview server

**URL:** <https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317>\
**Category:** Help\
**Created:** [January 1, 2018, 6:36pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317 "2018-01-01T18:36:39Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 1, 2018, 6:36pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/1 "2018-01-01T18:36:39Z")

</div>

Hi, I am a beginner on jekyll. I am following the documentation advice to Build the site on the preview server.  
Here is what a did :

- install the last version of ruby  
$ruby -v → ruby 2.4.1p111 (2017-03-22 revision 58053) [x86\_64-darwin16]  
$ gem --version → 2.6.14
- Install Jekyll  
$gem install jekyll bundler → Version of jekyll : jekyll-3.6.2

When I try to build the site on the preview server (bundle exec jekyll serve) there is the following error :

jekyll 3.6.2 | Error: (/Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/\_config.yml): did not find expected key while parsing a block mapping at line 16 column 1

the line 16 is the first line uncommented that shoul be processed. It is this one

> title: Inger Hair at Home at Aix en Provence (line 16)

I don’t see what can be wrong. Thank you in advance for your answers

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [January 1, 2018, 8:24pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/2 "2018-01-01T20:24:43Z")

</div>

If I had to guess it’s the parenthesis. Put it in quotes instead so it is treated as a string.

```auto
title: "Inger Hair at Home at Aix en Provence (line 16)"

```

---

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 1, 2018, 9:18pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/3 "2018-01-01T21:18:12Z")

</div>

Hi mmistakes and thank you for your answer. there isn’t any parenthesis. It was just an information of the line number for this post. And even when I put everything in quotes, I have the same error

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [January 1, 2018, 9:43pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/4 "2018-01-01T21:43:40Z")

</div>

Can you share your entire \_config.yml file or link to a public repo? YAML can be very unforgiving and there is likely an indent or missing colon or something similar around line 16.

---

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 2, 2018, 7:08am UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/5 "2018-01-02T07:08:36Z")

</div>

Hi mmistakes, and thank you for your answer. When I comment line 16 the error is at line 17. Here is the \_config.yml file

> <https://github.com/flamant/fileshare/blob/master/_config.yml>

---

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 2, 2018, 3:00pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/6 "2018-01-02T15:00:19Z")

</div>

Hi mmistakes, I found the solution : there were extra spaces at the exclude line. Now I am facing another issue which is the following

When I try to run

bundle exec jekyll serve

I have an error message which is the following

Dependency Error: Yikes! It looks like you don’t have /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/\_plugins/amp\_filter.rb  
or one of its dependencies installed. In order to use Jekyll as currently configured, you’ll need to install this gem. The full error  
message from Ruby is: ‘cannot load such file – nokogiri’ If you run into trouble, you can find helpful resources at [https://jekyllrb.com/help/](https://jekyllrb.com/help/)!

(I have the plugin amp\_filter.rb and at the beginning of amp\_filter.rb file, I have the following code

require 'nokogiri’  
require ‘fastimage’

)

as it says

‘cannot load such file – nokogiri’

So I installed nokogiri

MBP-de-Admin:Jekyll admin$ gem install nokogiri  
Building native extensions. This could take a while…  
/Users/admin/.rvm/rubies/ruby-2.4.1/lib/ruby/site\_ruby/2.4.0/rubygems/ext/builder.rb:76: warning: Insecure world writable dir /Users/admin in PATH, mode 040777  
Successfully installed nokogiri-1.8.1  
Parsing documentation for nokogiri-1.8.1  
Installing ri documentation for nokogiri-1.8.1  
Done installing documentation for nokogiri after 13 seconds  
1 gem installed

And I have still the same error. Thank you in advance for your answers

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [January 2, 2018, 10:40pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/7 "2018-01-02T22:40:17Z")

</div>

Have you reached out to the Jekyll AMP developer? This is a different issue from the bad YAML in your config file.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [January 2, 2018, 11:51pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/8 "2018-01-02T23:51:35Z")

</div>

> [@flamant](#):
>
> ‘cannot load such file – nokogiri

try googling just that - this may help though it is about rails not jekyll and is a couple years old:

> <https://stackoverflow.com/questions/28999906/require-cannot-load-such-file-nokogiri-nokogiri-loaderror-when-running>

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [January 3, 2018, 1:30am UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/9 "2018-01-03T01:30:24Z")

</div>

Instead of adding the plugin .rb files to your `_plugins` folder try removing them. Then install the [gem version of the plugin](https://rubygems.org/gems/amp-jekyll/versions/1.0.2) by adding `gem “amp-jekyll”` to your `Gemfile`.

Run `bundle update` then try to build your site with `bundle exec jekyll build`.

---

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 3, 2018, 6:28am UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/10 "2018-01-03T06:28:44Z")

</div>

> [@rdyar](#):
>
> cannot load such file – nokogiri

Hi mmistakes and rdyar , thank you for your answer. I googled it and I followed the instruction I read. I did

> gem install nokogiri

and checked that it was added (gem list)

and when I run

> bundle exec jekyll serve

I have the same error

> Configuration file: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/\_config.yml  
> Dependency Error: Yikes! It looks like you don’t have /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/\_plugins/amp\_filter.rb or one of its dependencies installed. In order to use Jekyll as currently configured, you’ll need to install this gem. The full error message from Ruby is: ‘cannot load such file – nokogiri’ If you run into trouble, you can find helpful resources at [Redirecting…](https://jekyllrb.com/help/)!  
> jekyll 3.6.2 | Error: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/\_plugins/amp\_filter.rb

Considering adding gem “amp-jekyll” (and other gems) in Gemfile ,that was what I did at the beginning but none of the gem in Gemfile were running. I had the error

> MBP-de-Admin:inger admin$ bundle exec jekyll serve  
> Could not find gem ‘amp-jekyll (= 1.0.2)’ in any of the gem sources listed in your Gemfile.

(and also the same error for the other gem)

So I chose to add the rb files in \_plugins folder

Assuming for the time being that I chose to add rb files in \_plugins folder, can you give me a way to solve my issue ? Thanks in advance

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [January 3, 2018, 7:09am UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/11 "2018-01-03T07:09:04Z")

</div>

> [@flamant](#):
>
> Considering adding gem “amp-jekyll” (and other gems) in Gemfile ,that was what I did at the beginning but none of the gem in Gemfile were running

That’s probably because you did not run `bundle install` after…  
So, the solution involves the following:

- Remove `_plugins/` directory
- Add `amp-jekyll` to your `Gemfile`

```ruby
source "https://rubygems.org"

gem "jekyll", "~> 3.6"
gem "minima", "~> 2.0"

group :jekyll_plugins do
  gem "amp-jekyll"
end

```

- Ensure the current directory in your terminal is the Jekyll project directory
- Run `bundle install`
- Start jekyll preview server

```auto
bundle exec jekyll serve

```

---

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 4, 2018, 9:55pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/12 "2018-01-04T21:55:30Z")

</div>

Hi ashmaroll. Thank you very much for your answer. I did what you said and it works.  
The only gem that I didn’t suceed in loading was “jekyll-ga” ([https://github.com/developmentseed/jekyll-ga](https://github.com/developmentseed/jekyll-ga)).

Do you think that putting

```
  gem "chronic" # with jekyll-ga # installed
  gem "google-api-client" # with jekyll-ga # installed

```

will be enough to use “jekyll-ga” ?

Another question. I found this ressource page : [https://rubygems.org/gems?letter=J&page=42](https://rubygems.org/gems?letter=J&page=42)  
Do you think there are all exhaustive gems that I can use in Gemfile ?

Finally, how can I grant you “a good answer” ?🙂

---

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 4, 2018, 9:59pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/13 "2018-01-04T21:59:57Z")

</div>

Hi again,

I don’t see also how to add “jekyll-ideal-image-slider”  
([https://github.com/jekylltools/jekyll-ideal-image-slider](https://github.com/jekylltools/jekyll-ideal-image-slider))

---

<div class="post-metadata">

**Author:** ![mmistakes](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/mmistakes/32/2169_2.png) [@mmistakes](https://talk.jekyllrb.com/u/mmistakes)\
**Post date:** [January 4, 2018, 11:59pm UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/14 "2018-01-04T23:59:31Z")

</div>

Doesn’t look like this plugin has been “gemified”. Meaning you don’t install it with Bundler but rather copy over its `_plugins` folder over into the root of your project.

> **[Plugins](https://jekyllrb.com/docs/plugins/)**
>
> Jekyll has a plugin system with hooks that allow you to create custom generated content specific to your site. You can run custom code for your site without having to modify the Jekyll source itself.

---

<div class="post-metadata">

**Author:** ![flamant](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flamant](https://talk.jekyllrb.com/u/flamant)\
**Post date:** [January 5, 2018, 6:59am UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/15 "2018-01-05T06:59:52Z")

</div>

Hi mmistakes and thank you for your answer. And what about “jekyll-ga” ?

---

<div class="post-metadata">

**Author:** ![ashmaroli](https://avatars.discourse-cdn.com/v4/letter/a/df705f/32.png) [@ashmaroli](https://talk.jekyllrb.com/u/ashmaroli)\
**Post date:** [January 5, 2018, 7:17am UTC](https://talk.jekyllrb.com/t/cannot-build-the-site-on-the-preview-server/1317/16 "2018-01-05T07:17:45Z")

</div>

`jekyll-ga` has not been updated for over 4 years now… and from the source-code, it doesn’t look like it will work with Jekyll 3.x series… (Jekyll::Post) had been removed prior to shipping Jekyll 3.0.0
