Jekyll Custom Theme- Gemspec Bundle Install Error: Unexpected Unary-, Expecting Keyword_Do

Gemfile `Bundler cannot continue` unexpected ':' error [Ruby]

Your Gemfile is a Ruby file for Bundler which specifies the gems your project needs. The plugins: section you've written in your Gemfile is YAML designed to go in _config.yml, not Ruby, hence your syntax error.

You'll need to rewrite this section of your Gemfile into Ruby, in a gem group jekyll_plugins so Jekyll knows to use those gems as plugins:

source "https://rubygems.org"

git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
gem "jekyll", "~> 3.8"

group :jekyll_plugins do
gem "jekyll-sitemap"
gem "jekyll-paginate"
gem "jekyll-redirect-from"
gem "github-pages"
end

There are other ways of doing this too, listed on the Jekyll documentation, but I'd recommend this one.

Jekyll theme could not be found

From what I gather, it looks like you did not add jekyll-theme-primer to your Gemfile, but instead simply executed gem "jekyll-theme-primer" in the terminal and later installed the gem correctly after encountering the Gem::CommandLineError

So, in short, simply follow the steps below:

  • Add the theme-gem to your Gemfile
  • add the theme to your _config.yml (correctly done already..)
  • Run: bundle install (just to make sure Bundler is able to use it)
  • Run: bundle exec jekyll serve

Adding a theme-gem to a Gemfile:

Open your current Gemfile in a text-editor, and replace entire line gem "minima", "~> 2.0" with your theme gem. i.e. gem "jekyll-theme-primer", "~> 0.4"

bundle exec jekyll serve Conflict: The following destination is shared by multiple files

It seems webrick does not come bundled with ruby 3.0. Check this jekyll github issue.

From
https://www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/:

The following libraries are no longer bundled gems or standard
libraries. Install the corresponding gems to use these features.

sdbm webrick net-telnet xmlrpc

You have two options

  1. Downgrade to ruby 2.5 as you have on ubuntu OR
  2. Add gem "webrick" in Gemfile.

Error Parsing 'Gemfile'

It is the quotation problem.

Try manually typing the sentence again with either single quote or double quote.

ruby '2.3.0' or ruby "2.3.0"

This should fix it.



Related Topics



Leave a reply



Submit