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
- Downgrade to ruby 2.5 as you have on ubuntu OR
- 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
Access Image from Different View in a View with Paperclip Gem Ruby on Rails
Knowing When Resque Worker Had Completed Job
Rails Undefined Method 'Errors' for Nil:Nilclass in Simple_Form
Make Map Marker Direct Link Onclick for Gmaps4Rails
Randomly Showing Nomethoderror: Undefined Method 'Empty' for 0:Fixnum
Ruby Parallel Assignment, Step Question
How to Remove the Extra Double Quote
Why Can't I Create Active Records That Count for Something in Rspec
Iterate and Set Ruby Object Instance Variables
I Want to Match All Punctuation in My Regexp Except Apostrophes. How to Do That in Ruby
Unexpected =>, Expecting '}' in Rspec Expect
How Does Rails Know My Timezone
Making a Pie-Chart of the User Age in Rails
Heroku_Can't Upgrade to Cedar-14
Slicing of Arrays in Ruby Returns Different Result - Nil VS. Empty Array
How to Create Activerecord Style Validations Outside of Activerecord