First custom theme issues

Hello again,

Some (stupid) newbie questions. Trying understand how all the things work.

After generate my first custom theme, trying:

$jekyll serve

And shows this error:

Bundler could not find compatible versions for gem “bundler”: (Bundler::VersionConflict)
** In Gemfile:**
** bundler (~> 1.16)**

** Current Bundler version:**
** bundler (2.0.2)**
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running gem install bundler?

Could not find gem ‘bundler (~> 1.16)’ in any of the relevant sources:
** the local ruby installation**

After that follow the instructions in the error-message, and type:

$gem install bundler

ERROR: While executing gem … (Gem::FilePermissionError)
** You don’t have write permissions for the /var/lib/gems/2.5.0 directory.**

It works perfect, when execute as root:

$sudo gem install bundler

  1. Is it normal that some ‘gem’-commands only works with root access?

After that retry:

$jekyll serve

But doesn’t work (again).

So, i solved change this line in gemspec:

spec.add_development_dependency “bundler”, "~> 1.16"

with this line

spec.add_development_dependency “bundler”, "~> 2.0.2"

  1. When generate a new theme then you want change the bundler version with the version on my machine?

After that trying adding the theme to my Jekyll website:

cd myproject

Open the Gemfile and adding mytheme:

gem “jekyll-theme-mytheme” => :path => "home/ubuntu/themes/jekyll-theme-mytheme"

Type:

$bundle

But gives again error’s:

[!] There was an error parsing Gemfile: syntax error, unexpected =>, expecting end-of-input - …ll-theme-mytheme" => :path => "home/ubuntu/themes/jekyll-t…
… ^~. Bundler cannot continue.

** # from /home/ubuntu/webapps/myproject/Gemfile:13**
** # -------------------------------------------**
** # gem “minima”, “~> 2.5”**
** > gem “jekyll-theme-mytheme” => :path => “home/ubuntu/themes/jekyll-theme-mytheme”**
** # # If you want to use GitHub Pages, remove the “gem “jekyll”” above and**
** # -------------------------------------------**

Try this also with:

gem "jekyll-theme-mytheme" => :path => "/themes/jekyll-theme-mytheme/"

gem "jekyll-theme-mytheme" => :path => "/"

Nothing works :neutral_face:

Hope someone can help me with this?

My working directories are:

Notes:

project: /home/ubuntu/webapps/myproject/

Themes: /home/ubuntu/themes/jekyll-theme-mytheme/

The error is that there is an incorrect usage of => in your Gemfile. Correct it as following:

- gem “jekyll-theme-mytheme” => :path => "home/ubuntu/themes/jekyll-theme-mytheme"
+ gem "jekyll-theme-mytheme", :path => "home/ubuntu/themes/jekyll-theme-mytheme"

If it still errors, ensure that the path string is correct…
Good luck!

@ashmaroli,

Thanks man, it works perfect!!!

Following this tutorial, and that was the reason, i’m using the wrong code: