# Invalid theme folder

**URL:** <https://talk.jekyllrb.com/t/invalid-theme-folder/2109>\
**Category:** Help\
**Created:** [August 26, 2018, 11:47am UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109 "2018-08-26T11:47:01Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![yashumittal](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/yashumittal/32/1260_2.png) [@yashumittal](https://talk.jekyllrb.com/u/yashumittal)\
**Post date:** [August 26, 2018, 11:47am UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109/1 "2018-08-26T11:47:01Z")

</div>

I am using a custom gem based theme locally.

```auto
gem "themename", '0.1.0', :path => "./"

```

But I am getting this error:

```auto
Invalid theme folder: _sass
Invalid theme folder: _includes
Invalid theme folder: _layouts

```

---

<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:** [August 26, 2018, 12:36pm UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109/2 "2018-08-26T12:36:20Z")

</div>

The warnings mean that those directories do not exist within the current theme. If those directories do exist, you may want to check the regex in the theme’s `gemspec` file…

---

<div class="post-metadata">

**Author:** ![yashumittal](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/yashumittal/32/1260_2.png) [@yashumittal](https://talk.jekyllrb.com/u/yashumittal)\
**Post date:** [August 26, 2018, 12:55pm UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109/3 "2018-08-26T12:55:33Z")

</div>

All those directories do exist.

Here’s the `.gemspec` file

```
spec.files = `git ls-files -z`.split("\x0").select { |f| f.match(%r!^(_data|assets|_layouts|_includes|_sass|LICENSE|README)!i) }

```

When I run `jekyll serve` in the theme directory it works file, but when I use that same theme gem in some other jekyll site, it doesn’t work.

---

<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:** [August 26, 2018, 1:06pm UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109/4 "2018-08-26T13:06:21Z")

</div>

Then its simply the incorrect entry in your Gemfile.  
It should just be

```ruby
gem "themename", :path => "path/to/themename"

```

There’s no need to include the version constraint when using the `path` parameter.  
`:path => "./"` means “current directory” which is obviously not the case in another jekyll site.

---

<div class="post-metadata">

**Author:** ![yashumittal](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/yashumittal/32/1260_2.png) [@yashumittal](https://talk.jekyllrb.com/u/yashumittal)\
**Post date:** [August 26, 2018, 1:11pm UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109/5 "2018-08-26T13:11:13Z")

</div>

> **NOTE:** I am using a local gem

If I use it without mentioning the version, it doesn’t work and I get this error.

```
Could not find gem 'themename' in source at `./`.
The source does not contain any versions of 'themename'
Run `bundle install` to install missing gems.

```

Here’s the tree structure.

![image](https://canada1.discourse-cdn.com/flex030/uploads/jekyllrb/original/2X/c/cbbe7ff5cf322366e5faacb0f373df7a2390e037.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:** [August 26, 2018, 1:21pm UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109/6 "2018-08-26T13:21:08Z")

</div>

`:path =>` should point to the directory containing your `gemspec`.

For example, if the theme is named `theme-yashu`, then I would have a directory named `theme-yashu` containing `theme-yashu.gemspec` with its `spec.name = "theme-yashu"`

Then the `Gemfile` in a site called `yashu-site` just outside theme directory `theme-yashu` would point to the theme gemspec:

```auto
gem "theme-yashu", :path => "../theme-yashu"
```

---

<div class="post-metadata">

**Author:** ![andreacorinti](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/andreacorinti/32/1319_2.png) [@andreacorinti](https://talk.jekyllrb.com/u/andreacorinti)\
**Post date:** [October 30, 2018, 3:04am UTC](https://talk.jekyllrb.com/t/invalid-theme-folder/2109/7 "2018-10-30T03:04:13Z")

</div>

I’m having the same problem:

apparently, my gem is visible to bundler only by specifying the version number ([as they say here](https://stackoverflow.com/questions/4271947/how-to-use-bundler-with-offline-gem-file))
