Setting Up Jekyll

jekyll

#1

Jekyll is a great static site generator, also used by github pages. You simply need to install the Ruby gem and then make sure you pass the right port to the serve.

$ gem install jekyll bundler
$ jekyll new my-awesome-site
$ cd my-awesome-site
$ jekyll serve --host $IP --port $PORT --baseurl ''

Problem setup jekyll
Jekyll questions
Tutorials - Table of Contents
#2

I’ve tried several variations of this, and it either shows me my hard-coded Jekyll menu with a 404 for the index page, or shows me the Jekyll site with no styles. Works fine if I deploy to github and then view it there.

I’ve tried adding the baseurl, leaving it blank, adding with / without https, etc…no luck so far. Any thoughts on this? Cloud9 works perfectly for a code in Cloud9 -> push to Github -> test workflow, but I’d like to get Jekyll server running on Cloud9 for faster debug cycles.

Thanks!


#3

What do I use for IP and port in Cloud 9? Very new to this.


#4

Use the IP and PORT environment variables, which usually default to 0.0.0.0 and 8080, respectively.


#5

Thank you very much, I will give this a try as soon as my lad is down for the night. Best regards and Happy New Year.


#6

Any way to get jekyll on c9 to work with browser-sync?


#7

This may work with some tinkering. Here’s an example of someone else that got it running outside of Cloud9.


#8

Hmm this might work, I’ll need to run some tests. If I understand correctly I would need to modify line 17 (the spawn command line) and the browser-sync task in the gulpfile to add port 8082 like it is in your blog post?


#9

Excellent, it worked! All I needed to do to get browser-sync to work (with that example) was to add a port option to the browser-sync task.

So the task would look like this:

gulp.task('browser-sync', ['sass', 'jekyll-build'], function() {
    browserSync({
        server: {
            baseDir: '_site'
        },
        port:8080
    });
});

Thank you! :smiley:


#10

Well, that didn’t work at all.

I followed the same steps and got the error message:
/usr/local/rvm/gems/ruby-2.3.0/gems/bundler-1.14.3/lib/bundler/resolver.rb:379:in `block in verify_gemfile_dependencies_are_found!’: Could not find gem ‘minima (~> 2.0)’ in any of the gem sources listed in your Gemfile. (Bundler::GemNotFound)


#11

Hmm. I tried again, and this time it worked. I can’t figure what the difference is in the two attempts, except that on the first attempt, I used the “Ruby” template, while on the second attempt, I used a blank template.


#12

Still unable to get this up and running also. I’ve got the added difficulty of trying to get it to work on an existing github repo? Any tips?


#13

The first step should be

$ gem install jekyll bundler

As bundler is a required dependency:

kalinchernev:~/workspace (master) $ jekyll new my-awesome-site
  Dependency Error: Yikes! It looks like you don't have bundler or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- bundler' If you run into trouble, you can find helpful resouhttps://community.c9.io/t/setting-up-jekyll/1707rces at https://jekyllrb.com/help/! 
jekyll 3.4.3 | Error:  bundler

More detailed tutorial on having jekyll on ubuntu


#14

@kalinchernev awesome, just updated it.


#15

Here is an extended version of the instructions:

  1. create a free account on Cloud9.
  2. create an empty project (Ubuntu) and follow these steps:
  3. type on the command line: gem install jekyll
  4. create an empty _config.yml file in the root
  5. create a index.md file in the root
  6. type on the command line: jekyll serve --host $IP --port $PORT --baseurl ‘’
  7. your Jekyll website is now running ‘locally’ on Cloud9 in the most basic setup possible

The content of your index.md file:

---
title: Home
---

Hello world!