spuder
spuder

Reputation: 18467

How do you setup github.io page with jekyll?

I am attempting to setup a project page using githubs pages functionality.

I'm using bundler to install jekyll as shown in the instructions however it produces the following error:

$ bundle exec jekyll serve
Notice: for 10x faster LSI support, please install http://rb-gsl.rubyforge.org/
Configuration file: none
            Source: /Users/sowen/Code/all-spark-cube
       Destination: /Users/sowen/Code/all-spark-cube/_site
      Generating... 
             ERROR: YOUR SITE COULD NOT BE BUILT:
                    ------------------------------------
                    Post '/vendor/ruby/2.1.0/gems/jekyll-2.2.0/lib/site_template/0000-00-00-welcome-to-jekyll.markdown.erb' does not have a valid date. Fix the date, or exclude the file or directory from being processed

I've tried on a brand new installation of OsX using ruby 2.0.0. I've also tried using rvm to install ruby 2.1.1 with the same results.

Here are the steps I've taken:

ruby --version
ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin12.0]

$ cd ~/Code/all-spark-cube

$ cat Gemfile
source 'https://rubygems.org'
gem 'github-pages'

$  bundle install
$ ...

This produces the following directory structure

$ tree -L 1
.
├── Gemfile
├── Gemfile.lock
└── vendor

Strangely the file mentioned above (000-00-00-welcome-to-jekyll..) does not exist at location shown. I did find it at vendor/ruby/2.1.0/gems/jekyll-2.2.0/lib/site_template/_posts/0000-00-00-welcome-to-jekyll.markdown.erb I've tried removing and renaming it with no luck.

Also strange that it is referring to an absolute path /vendor/ and not a relative path vendor/.

Searching google, I am able to find a few resources that mention this error, however I am not able to work around this. Is this a problem with the gem, the documentation, or my configuration?

http://www.markcampbell.me/jekyll/heroku/2013/05/18/how-to-set-up-jekyll-on-heroku.html

Upvotes: 0

Views: 1756

Answers (2)

Gustavo Russo
Gustavo Russo

Reputation: 171

The error is due to you generated your site in the same directory that you installed Jekyll.

To avoid the error, add this line to your site _config.yml file:

exclude: [vendor]

A better solution would be to deploy your site in a subdirectory of Jekyll folder:

  1. Install Jekyll using Bundler in the same way that you already did
  2. Create your site in a subfolder using: bundle exec jekyll new ./all-spark-cube --force
  3. Navigate into the subfolder where you created the site and run your Jekyll site locally: bundle exec jekyll serve

This second solution will help to keep your site code clean when you push it to github

Upvotes: 1

Joel Glovier
Joel Glovier

Reputation: 7679

Running bundler is only for projects that already have a gemfile with jekyll include. For brand new projects you need to run gem install jekyll.

A better place to start with just installing jekyll is http://jekyllrb.com/.

Once you have Jekyll installed locally, and a new site created (jekyll new), you can create a git repository (git init) and then push it to GitHub.

Upvotes: 2

Related Questions