Mac OSX Mojave, Ruby v 2.5.3, Bundler v 1.17.2. Homebrew installed.
This is a noob question but can’t make progress. I’m wanting to run a site of my local machine (which I was doing previously without problems.)
I cloned an existing jekyll site to my desktop and then entered bundle exec jekyll build. Got the error message ‘no gemfile’ so I followed the instructions on the jekyll page to install gems etc.
If I run Jekyll Build I get:
Liquid Exception: Could not locate the included file ‘links.html’ in any of ["/Users/jonathanshearman/Desktop/recover/January/_includes"]. Ensure it exists in one of those directories and, if it is a symlink, does not point outside your site source. in /Users/jonathanshearman/Desktop/recover/January/_posts/2015-04-12-test-post-last-year.md
jekyll 3.8.5 | Error: Could not locate the included file ‘links.html’
But the file is not missing.
If I run bundle exec jekyll build, I get
bundler: failed to load command: jekyll (/usr/local/lib/ruby/gems/2.5.0/bin/jekyll)
Gem::Exception: can’t find executable jekyll for gem jekyll. jekyll is not currently included in the bundle, perhaps you meant to add it to your Gemfile?
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:462:in block in replace_bin_path' /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:482:inblock in replace_bin_path’
/usr/local/lib/ruby/gems/2.5.0/bin/jekyll:23:in `<top (required)>’
The easiest way someone can help you is if you can give them a link to your fork if it is a public repository.
Nevertheless, let us make do with what’s currently available.
From the error messages, it looks like your site doesn’t have a Gemfile.
When there is no Gemfile, you can’t use bundle exec.
If you have a Gemfile, ensure that you’ve either of the following listed in it:
gem 'jekyll', '~> 3.3'
# **or** if you're deploying via GitHub Pages
gem 'github-pages'
The other error is that Jekyll cannot find an include named links.html. This error occurs when Jekyll can’t find _includes/links.html or another file the include itself is including…
Note:
Included file should not be a symlink.
_includes/link.html is relative to the site’s source. If you override default source, the include has to change path accordingly.
It’s a sandbox - I’m using a template to learn Jekyll-Markdown-Git. It builds fine on GitHub pages (as can be seen), but I was trying to run it locally, as I had been doing previously. So I cloned the repo using GitHub Desktop, navigated to the directory, and entered bundle exec jekyll serve. That was when I got the error message ‘no gemfile’. Went back and followed the instructions on Jekyll on installing gems and tried again.
what happens if you just run jekyll build? bundler is recommended but not required. Bundler helps keep different gems in sync between different installations so you get the same behavior. I don’t use it.
Sirius:January jonathanshearman$ bundle exec jekyll build bundler: failed to load command: jekyll (/usr/local/lib/ruby/gems/2.5.0/bin/jekyll) Gem::Exception: can't find executable jekyll for gem jekyll. jekyll is not currently included in the bundle, perhaps you meant to add it to your Gemfile? /usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:462:inblock in replace_bin_path’
/usr/local/lib/ruby/gems/2.5.0/gems/bundler-1.17.2/lib/bundler/rubygems_integration.rb:482:in block in replace_bin_path' /usr/local/lib/ruby/gems/2.5.0/bin/jekyll:23:in<top (required)>’
`
@Wayfarer I saw one thorn in your repo. As you were experimenting with your site, you ran a wrong command:
jekyll new .--force
The correct command is jekyll new . --force (whitespace matters) Nevertheless, do not try that on your site since the correct command will delete your existing site.
You can safely delete the ./.--force directory from your repo. It is not needed and will only confuse new users of your sandbox.
Well, I’m the only user, and it surely confused me!
I’m creating a real site based on this template, but trying out things in the sandbox before committing to the real site. But, thus warned, I will delete that ‘thorn’ from my sandbox, just to keep things neat and tidy.
What I was trying to accomplish by running the site locally, was to use the locally-hosted version for staging, so as not having to push numbers of tiny edits out to the live site while in the edit process.
So the idea is, open the local version in Atom and save changes as you go - you review them on the locally-run version, and then push them out to GitHub when you’ve got a decent bunch of changes. Does that make sense?