# Setting up "amp-jekyll" plugin leads to an error

**URL:** <https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332>\
**Category:** Help\
**Created:** [January 5, 2018, 8:45pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332 "2018-01-05T20:45:57Z")\
**Posts on this page:** 20\
**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 5, 2018, 8:45pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/1 "2018-01-05T20:45:57Z")

</div>

Hi,  
I added amp-jekyll plugin in my Gemfile

gem “amp-jekyll”, “1.0.2”

> **[juusaw/amp-jekyll](https://github.com/juusaw/amp-jekyll)**
>
> Build Accelerated Mobile Page versions of your Jekyll posts - juusaw/amp-jekyll

I Placed the layout file (amp.html) to the \_layouts folder

I added the following code in the footer.html

```
{% if page.path contains '_posts' %}
  <link rel="amphtml" href="{{ page.id | prepend: '/YOURDIR' | prepend: site.baseurl | prepend: site.url | append: '.html' }}">
{% endif %} 

```

And when I want to run `jekyll build`

I get the following error

```
MBP-de-Admin:inger admin$ jekyll build
Configuration file: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_config.yml
            Source: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger
       Destination: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Liquid Exception: undefined method `start_with?' for nil:NilClass in /_layouts/amp.html
jekyll 3.6.2 | Error: undefined method `start_with?' for nil:NilClass

```

Thank you in advance for your answers

---

<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 5, 2018, 9:44pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/2 "2018-01-05T21:44:17Z")

</div>

no idea if this is your problem but did you change YOURDIR?

`<link rel="amphtml" href="{{ page.id | prepend: '/YOURDIR' | prepend: site.baseurl | prepend: site.url | append: '.html' }}">`

---

<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, 10:06pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/3 "2018-01-05T22:06:49Z")

</div>

Hi rdyar and thank you for your answer. Yes of course, I changed YOURDIR into the directory of my project

```
{% if page.path contains '_posts' %}
  <link rel="amphtml" href="{{ page.id | prepend: '/inger' | prepend: site.baseurl | prepend: site.url | append: '.html' }}">
{% endif %}
```

---

<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 5, 2018, 11:37pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/4 "2018-01-05T23:37:15Z")

</div>

ha ha - well had to ask.

Try running `jekyll build -V` to do a verbose log, maybe it will show more what is going on.

---

<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 6, 2018, 2:14am UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/5 "2018-01-06T02:14:09Z")

</div>

You can additionally run the `build` command with the `--trace` option to get more details on the error:

```auto
bundle exec jekyll build --trace

```

It’s hard to suggest a solution without seeing the site and how its set up currently…

---

<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 6, 2018, 9:56am UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/6 "2018-01-06T09:56:53Z")

</div>

Hi rdyar and ashmaroli and thank you for your answers. I don’t see from where is coming the error. Browsing on internet, I can see that is kind of error is generic. Here is the trace when I ran  
`MBP-de-Admin:inger admin$ jekyll build -V`

```
  Logging at level: debug
Configuration file: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_config.yml
         Requiring: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_plugins/ideal_image_slider.rb
         Requiring: jekyll-feed
         Requiring: kramdown
            Source: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger
       Destination: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
       EntryFilter: excluded /Inger-Analytics-feb0aa8b73d1.json
           Reading: _posts/2017-12-30-welcome-to-jekyll.markdown
        Generating: Jekyll::AmpGenerator finished in 0.004647 seconds.
        Generating: JekyllFeed::Generator finished in 0.001888 seconds.
        Generating: Jekyll::JekyllSitemap finished in 0.000933 seconds.
         Rendering: _posts/2017-12-30-welcome-to-jekyll.markdown
  Pre-Render Hooks: _posts/2017-12-30-welcome-to-jekyll.markdown
  Rendering Liquid: _posts/2017-12-30-welcome-to-jekyll.markdown
         Requiring: rouge
  Rendering Markup: _posts/2017-12-30-welcome-to-jekyll.markdown
         Requiring: kramdown
  Rendering Layout: _posts/2017-12-30-welcome-to-jekyll.markdown
         Rendering: 404.html
  Pre-Render Hooks: 404.html
  Rendering Liquid: 404.html
  Rendering Markup: 404.html
  Rendering Layout: 404.html
         Rendering: about.md
  Pre-Render Hooks: about.md
  Rendering Liquid: about.md
  Rendering Markup: about.md
  Rendering Layout: about.md
         Rendering: index.html
  Pre-Render Hooks: index.html
  Rendering Liquid: index.html
  Rendering Markup: index.html
  Rendering Layout: index.html
         Rendering: css/style.scss
  Pre-Render Hooks: css/style.scss
  Rendering Liquid: css/style.scss
  Rendering Markup: css/style.scss
         Rendering: assets/main.scss
  Pre-Render Hooks: assets/main.scss
  Rendering Liquid: assets/main.scss
  Rendering Markup: assets/main.scss
         Rendering: amp/jekyll/update/2017/12/30/welcome-to-jekyll/index.html
  Pre-Render Hooks: amp/jekyll/update/2017/12/30/welcome-to-jekyll/index.html
  Rendering Liquid: amp/jekyll/update/2017/12/30/welcome-to-jekyll/index.html
         Requiring: rouge
  Rendering Markup: amp/jekyll/update/2017/12/30/welcome-to-jekyll/index.html
  Rendering Layout: amp/jekyll/update/2017/12/30/welcome-to-jekyll/index.html
  Liquid Exception: undefined method `start_with?' for nil:NilClass in /_layouts/amp.html
jekyll 3.6.2 | Error: undefined method `start_with?' for nil:NilClass

```

I suppose that the error occurs in index.html (or may be afterwards ?)

Here is my index.html page

```
---
layout: default
title: Hank Quinlan, Horrible Cop
lang: fr
---
<div class="blurb">
	<h1>Hi there, I'm Hank Quinlan!</h1>
	<p>I'm best known as the horrible cop from <em>A Touch of Evil</em> Don't trust me. <a href="/about">Read more about my life...</a></p>
</div><!-- /.blurb -->

```

Here is my default.html

```
<!DOCTYPE html>

            {% include header.html %}
			
			{{ content }}

            {% include footer.html %}

```

and here is my footer.html

```
			</div><!-- /.container -->
			<footer>
	    		<ul>
	        		<li><a href="mailto:hankquinlanhub@gmail.com">email</a></li>
	        		<li><a href="https://github.com/hankquinlan">github.com/hankquinlan</a></li>
				</ul>
			</footer>
		</body>
<script>
function setActive() {
  var aObj = document.getElementsByClassName("mainMenu").getElementsByTagName('a');
  for(i=0;i<aObj.length;i++) {
    if(document.location.href.indexOf(aObj[i].href)>=0) {
      aObj[i].className='active';
    }
  }
}
window.onload = setActive;
</script>
<link rel="stylesheet" type="text/css" href="/css/style.css">
{% if page.path contains '_posts' %}
  <link rel="amphtml" href="{{ page.id | prepend: '/inger' | prepend: site.baseurl | prepend: site.url | append: '.html' }}">
{% endif %}
<script src="assets/javascript/common/google_map_api.js"></script>
</html>

```

Here is my \_config.yml content

```
# Welcome to Jekyll!
#
# This config file is meant for settings that affect your whole blog, values
# which you are expected to set up once and rarely edit after that. If you find
# yourself editing this file very often, consider using Jekyll's data files
# feature for the data you need to update frequently.
#
# For technical reasons, this file is *NOT* reloaded automatically when you use
# 'bundle exec jekyll serve'. If you change this file, please restart the server process.

# Site settings
# These are used to personalize your new site. If you look in the HTML files,
# you will see them accessed via {{ site.title }}, {{ site.email }}, and so on.
# You can create any custom variable you would like, and they will be accessible
# in the templates via {{ site.myvariable }}.
title: Inger Hair at Home at Aix en Provence
email: flamant@club-internet.fr
description: #>- # this means to ignore newlines until "baseurl:"
  This site is intended to introduce the activity of hair at home of Inger at Aix en Provence.
baseurl: "" # the subpath of your site, e.g. /blog
url: "https://localhost" # the base hostname & protocol for your site, e.g. http://example.com
#baseurl: "" # the subpath of your site, e.g. /blog
#url: "https://flamant.github.io" # the base hostname & protocol for your site, e.g. http://example.com
twitter_username: jekyllrb
github_username: flamant

# Build settings
markdown: kramdown
theme: minima
plugins:
  - jekyll-feed

# Exclude from processing.
# The following items will not be processed, by default. Create a custom list
# to override the default setting.
exclude:
  - Gemfile
  - Gemfile.lock
  - node_modules
  - vendor/bundle/
  - vendor/cache/
  - vendor/gems/
  - vendor/ruby/
  - Inger-Analytics-feb0aa8b73d1.json
  - .gitignore
  
defaults:
  -
    scope:
      path: ""
    values:
      lang: fr
   
# Source language is optional. If set, translations to it will not be
# performed.
#source_lang: en
translations:
  en:
    callTheNumber: Contact me at
    sendmeAMail: Send me a mail
    clickHere: click here
    ingerHairStylingAtHome: INGER HAIRSTYLING SERVICE AT HOME
    home: HOME
    whoIAm: WHO I AM
    tariffs2018: TARIFFS 2018
    coveredMunicipalities: COVERED MUNICIPALITIES
    facebook: facebook
  fr:
    callTheNumber: Appelez moi au
    sendmeAMail: Envoyez moi un mail
    clickHere: cliquez ici
    ingerHairStylingAtHome: INGER COIFFURE A DOMICILE
    home: ACCUEIL
    whoIAm: QUI SUIS-JE
    tariffs2018: TARIFS 2018
    coveredMunicipalities: LES COMMUNES DESSERVIES
    facebook: facebook    

Here is the trace when I ran 

```

`MBP-de-Admin:inger admin$ bundle exec jekyll build --trace`

```
Configuration file: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_config.yml
            Source: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger
       Destination: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Liquid Exception: undefined method `start_with?' for nil:NilClass in /_layouts/amp.html
/Users/admin/.rvm/gems/ruby-2.4.1/gems/amp-jekyll-1.0.2/lib/jekyll/amp_filter.rb:19:in `block in amp_images': undefined method `start_with?' for nil:NilClass (NoMethodError)
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:190:in `block in each'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `upto'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/nokogiri-1.8.1/lib/nokogiri/xml/node_set.rb:189:in `each'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/amp-jekyll-1.0.2/lib/jekyll/amp_filter.rb:14:in `amp_images'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/strainer.rb:56:in `invoke'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/context.rb:86:in `invoke'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/variable.rb:78:in `block in render'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/variable.rb:76:in `each'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/variable.rb:76:in `inject'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/variable.rb:76:in `render'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/block_body.rb:109:in `render_node'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/block_body.rb:88:in `block in render'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/block_body.rb:75:in `each'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/block_body.rb:75:in `render'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/template.rb:208:in `block in render'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/template.rb:242:in `with_profiling'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/template.rb:207:in `render'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/liquid-4.0.0/lib/liquid/template.rb:220:in `render!'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/liquid_renderer/file.rb:30:in `block (2 levels) in render!'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/liquid_renderer/file.rb:42:in `measure_bytes'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/liquid_renderer/file.rb:29:in `block in render!'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/liquid_renderer/file.rb:49:in `measure_time'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/liquid_renderer/file.rb:28:in `render!'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/renderer.rb:123:in `render_liquid'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/renderer.rb:188:in `render_layout'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/renderer.rb:155:in `place_in_layouts'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/renderer.rb:85:in `render_document'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/renderer.rb:62:in `run'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/site.rb:466:in `block in render_pages'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/site.rb:464:in `each'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/site.rb:464:in `render_pages'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/site.rb:193:in `render'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/site.rb:73:in `process'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/command.rb:28:in `process_site'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/commands/build.rb:65:in `build'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/commands/build.rb:36:in `process'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/lib/jekyll/commands/build.rb:18:in `block (2 levels) in init_with_program'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `block in execute'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `each'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/mercenary-0.3.6/lib/mercenary/command.rb:220:in `execute'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/mercenary-0.3.6/lib/mercenary/program.rb:42:in `go'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/mercenary-0.3.6/lib/mercenary.rb:19:in `program'
	from /Users/admin/.rvm/gems/ruby-2.4.1/gems/jekyll-3.6.2/exe/jekyll:15:in `<top (required)>'
	from /Users/admin/.rvm/gems/ruby-2.4.1/bin/jekyll:23:in `load'
	from /Users/admin/.rvm/gems/ruby-2.4.1/bin/jekyll:23:in `<main>'
	from /Users/admin/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `eval'
	from /Users/admin/.rvm/gems/ruby-2.4.1/bin/ruby_executable_hooks:15:in `<main>'

```

And finaly, here is my project tree

 ![50](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/1X/211917348c2dd54c71d547513ee7be7421ab4db5.png)

---

<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 6, 2018, 9:58am UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/7 "2018-01-06T09:58:14Z")

</div>

Here is the last part of project tree

 ![31](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/1X/1e64a5326d6ff4d1529746ac9d28b85b2d8c87f9.png)

---

<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 6, 2018, 10:01am UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/8 "2018-01-06T10:01:14Z")

</div>

Sorry, this the one

 ![08](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/1X/e418638164a9578c1a7e4d2b7c2afffbc8649aa8.png)

---

<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 6, 2018, 12:51pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/9 "2018-01-06T12:51:36Z")

</div>

> [@flamant](#):
>
> Generating…  
> Liquid Exception: undefined method `start_with?' for nil:NilClass in /_layouts/amp.html /Users/admin/.rvm/gems/ruby-2.4.1/gems/amp-jekyll-1.0.2/lib/jekyll/amp_filter.rb:19:in `block in amp\_images’: undefined method `start\_with?’ for nil:NilClass (NoMethodError)

The error stems from Line:19 in the `amp_filter.rb` of the `amp-jekyll` plugin…

> <https://github.com/juusaw/amp-jekyll/blob/f077aa422245f49ee49a60efdb3889fda287c77d/lib/jekyll/amp_filter.rb#L19>

Bring this issue up with the gem author and he’ll either tell you how to proceed or he’ll fix the bug in his code…

---

<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 6, 2018, 2:39pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/10 "2018-01-06T14:39:02Z")

</div>

Thanks a lot ashmaroli, and sorry, I should have seen the error earlier. But thank you for your advice to bring the issue to the author.

Previously I loaded the plugins putting the “files.rb” (like amp\_filter.rb) into \_plugins directory. Secondly, I deleted those "files.rb’ from the \_plugins directory and used finally the loading in Gemfile. Shoudn’t I to programmatically uninstall “files.rb” (like amp\_filter.rb) from a directory placed somewhere in my computer or is it also the result of the loading of gems in Gemfile ?

---

<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 7, 2018, 5:27pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/11 "2018-01-07T17:27:56Z")

</div>

Hi ashmaroli,  
I found the error. I had in my header.html (that I include in index.html) an image defined as following

`<img width="16" height="16" alt="phone icon" scr="{{site.url}}{{site.baseurl}}/assets/images/icons/Phone_number-16px-16px.png">`

This was causing the following error

```
MBP-de-Admin:inger admin$ bundle exec jekyll build
Configuration file: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_config.yml
            Source: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger
       Destination: /Users/admin/Documents/Perso/Site-Internet/Jekyll/inger/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
  Liquid Exception: undefined method `start_with?' for nil:NilClass in /_layouts/amp.html
jekyll 3.6.2 | Error: undefined method `start_with?' for nil:NilClass

```

When I remove this img tag, there no more error.

So I tried to embed an a amp-img tag like the following

`<amp-img width="16" height="16" alt="phone icon" scr="{{site.url}}{{site.baseurl}}/assets/images/icons/Phone_number-16px-16px.png" layout="responsive"></amp-img>`

But I can’t see the image. I tried to remove {{site.url}}{{site.baseurl}} from the url (to have a relative path) but it doesn’t work. I did as the following link explain but I have no result.

> **[amp-img (Built-in) – AMP](https://www.ampproject.org/docs/reference/components/amp-img)**
>
> Accelerated Mobile Pages Project

Thank you in advance for your answers

---

<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 8, 2018, 11:50am UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/12 "2018-01-08T11:50:26Z")

</div>

The issue could be the missing `/` between `{{ site.url }}` and `{{ site.baseurl }}`…  
To avoid confusion use the built-in URLFilters… ( `absolute_url` and `relative_url` )

```auto
<amp-img
  width="16"
  height="16"
  alt="phone icon"
  src="{{ 'assets/images/icons/Phone_number-16px-16px.png' | absolute_url }}" 
  layout="responsive">
</amp-img>

```

or

```auto
<amp-img
  width="16"
  height="16"
  alt="phone icon"
  src="{{ 'assets/images/icons/Phone_number-16px-16px.png' | relative_url }}" 
  layout="responsive">
</amp-img>

```

---

<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 8, 2018, 8:40pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/13 "2018-01-08T20:40:08Z")

</div>

Hello ashmaroli and thank you for your answer. Thank you for your advice. But unfortunately nothing shows up, whatever url I set. I checked each time the url and the access to the image

---

<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 10, 2018, 9:38pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/14 "2018-01-10T21:38:22Z")

</div>

Hello, I think that I integrate in a bad way the “amp.html” file according to the documentation ([https://github.com/juusaw/amp-jekyll](https://github.com/juusaw/amp-jekyll)).

I put it in the \_layouts folder but without using it somewhere else. As the images I test are in \_includes/header.html file which is the following:

> <https://github.com/flamant/fileshare/blob/master/header.html>

I can’t see the utility of the “amp.html” file. Shall I change it, integrate it somewhere, reference it somewhere ? Thank you for your answer

---

<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 11, 2018, 12:10am UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/15 "2018-01-11T00:10:31Z")

</div>

Have you tried pinging the plugin developer? Doesn’t appear any of us are users of it so your guess is as good as ours 🤓

---

<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 14, 2018, 10:33am UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/16 "2018-01-14T10:33:16Z")

</div>

Hello mmistake and thank you for your answer. I pinged the plugin developer but until now no answer. I moved forward and propose a new “header.html” wich is the following : [https://github.com/flamant/fileshare/blob/master/header\_1.html](https://github.com/flamant/fileshare/blob/master/header_1.html)

 ![18](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/1X/0e300c83fbff556dc6830df63f958d02811c8ab1.png)  
But I have the following errors in console

I don’t understand why it doesn’t take into account my src attributes even when I hardcode the url. I checked on browser each url that I wrote and it leads to the proper image. Thank you in advance

---

<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 14, 2018, 4:49pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/17 "2018-01-14T16:49:11Z")

</div>

i know nothing about amp, but their example of an amp-image tag has a closing tag that you don’t. And even if that is not needed and it is self closing I think you need a slash at the end.

> **[Include an image – AMP](https://www.ampproject.org/docs/getting_started/create/include_image)**
>
> Accelerated Mobile Pages Project

---

<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 14, 2018, 5:23pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/18 "2018-01-14T17:23:32Z")

</div>

Hello rdyar and thank you for your answer, sorry but my amp-img tag has a closing tag

---

<div class="post-metadata">

**Author:** ![pabloduo](https://avatars.discourse-cdn.com/v4/letter/p/2bfe46/32.png) [@pabloduo](https://talk.jekyllrb.com/u/pabloduo)\
**Post date:** [January 15, 2018, 7:28pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/19 "2018-01-15T19:28:34Z")

</div>

@flamant, have you been able to find the solution for your problem?

If you still have troubles to get it up & running, can you share your Github repository?

So I can clone it and build your Jekyll pages locally - armed with all the debugging tools I might be able to track down the issues & errors you’re struggling with.

---

<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 16, 2018, 8:40pm UTC](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332/20 "2018-01-16T20:40:27Z")

</div>

Hello pabloduo and thank you for your answer  
It is very nice to offer your support

Here is the link to my project repository (it is the beginning of the project)

> **[flamant/inger](https://github.com/flamant/inger)**
>
> project hairdressing. Contribute to flamant/inger development by creating an account on GitHub.

regards

[Next page](https://talk.jekyllrb.com/t/setting-up-amp-jekyll-plugin-leads-to-an-error/1332.md?page=2)
