# Gemfile, \_plugins folder, dependency error

**URL:** https://talk.jekyllrb.com/t/gemfile-plugins-folder-dependency-error/5271
**Category:** Help
**Created:** [November 25, 2020, 11:25pm UTC](https://talk.jekyllrb.com/t/gemfile-plugins-folder-dependency-error/5271 "2020-11-25T23:25:48Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![jpc](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jpc/32/2643_2.png) [@jpc](https://talk.jekyllrb.com/u/jpc)
#### Post date: [November 25, 2020, 11:25pm UTC](https://talk.jekyllrb.com/t/gemfile-plugins-folder-dependency-error/5271/1 "2020-11-25T23:25:48Z")

</div>

Hello,  
In order to test a private plugin, I created a \_plugins folder in the root of my project.

- I copied an existing plugin (jekyll-leaflet) in this folder, that will be my future private plugin;
- I removed jekyll-leaflet from the Gemfile file;
- I didn’t change the \_config.yml file.

Now I have plugins defined in gemfile file and in \_plugins folder.

Is it correct ? because I have a dependency error !

> jekyll build JEKYLL\_ENV=production

> Dependency Error: Yikes! It looks like you don’t have /home/jpc/faune\_flore\_meyrin/\_plugins/lib/jekyll-leaflet.rb or one of its dependencies installed. In order to use Jekyll as currently configured, you’ll need to install this gem. If you’ve run Jekyll with `bundle exec`, ensure that you have included the /home/jpc/faune\_flore\_meyrin/\_plugins/lib/jekyll-leaflet.rb gem in your Gemfile as well. The full error message from Ruby is: ‘cannot load such file – jekyll-leaflet/leaflet-map’ If you run into trouble, you can find helpful resources at [Redirecting…](https://jekyllrb.com/help/)!

Shall I also declare my plugin in Gemfile ?

In my \_config.yml:

> plugins: - jekyll-feed - jekyll-include-cache - jekyll-paginate - jekyll-sitemap - jekyll-exif-data - html-proofer - jekyll-leaflet - jekyll-email-protect

My \_plugins folder:  
.  
└── lib  
├── jekyll-leaflet  
│ ├── filters  
│ │ └── replace-hrefs.rb  
│ ├── leaflet-items  
│ │ ├── leaflet-geojson.rb  
│ │ └── leaflet-marker.rb  
│ ├── leaflet-map.html  
│ ├── leaflet-map.js  
│ ├── leaflet-map.rb  
│ ├── leaflet-providers.js  
│ ├── leaflet-providers-license.md  
│ └── \_parse-liquid.rb  
└── jekyll-leaflet.rb

jekyll-leafler.rb content:

require “jekyll-leaflet/leaflet-map”  
require “jekyll-leaflet/leaflet-items/leaflet-marker”  
require “jekyll-leaflet/leaflet-items/leaflet-geojson”  
require “jekyll-leaflet/filters/replace-hrefs”

---

<div class="post-metadata">

### Author: ![jpc](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jpc/32/2643_2.png) [@jpc](https://talk.jekyllrb.com/u/jpc)
#### Post date: [November 26, 2020, 12:58pm UTC](https://talk.jekyllrb.com/t/gemfile-plugins-folder-dependency-error/5271/2 "2020-11-26T12:58:16Z")

</div>

I guess to have found myself …

- In jekyll-leaflet.rb, require request a full path for each rb file;
- In \_config.yml, in the plugins list, jekyll-leaflet shall also be referended with a full path

Tell me how to avoid that please !

---

<div class="post-metadata">

### Author: ![MichaelCurrin](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/michaelcurrin/32/2340_2.png) [@MichaelCurrin](https://talk.jekyllrb.com/u/MichaelCurrin)
#### Post date: [November 26, 2020, 9:49pm UTC](https://talk.jekyllrb.com/t/gemfile-plugins-folder-dependency-error/5271/3 "2020-11-26T21:49:51Z")

</div>

Use require\_relative

See for example here I have a plugin file which loads requests.rb in the same folder

> <https://github.com/MichaelCurrin/my-github-projects/blob/master/_plugins/process.rb#L2>

Or you can put your gem in a github repo with a `.gemspec` file and install by adding this to Gemfile

```auto
group :jekyll_plugins do
  gem "jekyll-resize", git: "https://github.com/MichaelCurrin/jekyll-resize"
end

```

Change to suit your gem.

Then

```auto
bundle install
bundle exec jekyll serve

```

Note that if you include a gem inside the group as I did above, it will be enabled and you don’t have to add it to plugins on config.

See the structure of my gem here

> **[MichaelCurrin/jekyll-resize](https://github.com/MichaelCurrin/jekyll-resize)**
>
> Image resizing tag for Jekyll - fork to support Jekyll 4 - MichaelCurrin/jekyll-resize

---

<div class="post-metadata">

### Author: ![jpc](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/jpc/32/2643_2.png) [@jpc](https://talk.jekyllrb.com/u/jpc)
#### Post date: [November 26, 2020, 10:19pm UTC](https://talk.jekyllrb.com/t/gemfile-plugins-folder-dependency-error/5271/4 "2020-11-26T22:19:02Z")

</div>

Thank you but, for the time being, I continue with a local plugin.

Could you have a look on another question:

> [@Display image from a plugin (.rb / javascript file)](https://talk.jekyllrb.com/t/display-image-from-a-plugin-rb-javascript-file/5273):
>
> Hello, In a .md file we can use the following format to display an image: \<img src={{ “images/joo.jpg” | relative\_url }} /\> But in a .rb file how to display an image which is in images folder ? In my case this image is not found. Problem of path solved with relative\_url in .md file function \_addMarkerToMap(leafletItem, map){ var m = leafletItem.value; if ('label' in m){ var result = L.marker([m.latitude,m.longitude]).bindTooltip(m.label,{permanent:true}).addTo(map).openToolt…
