How To

Pushing Your First Jekyll Site On GitHub

I simply messed up my Ruby and gems installation. I was messing it up from more than a week, a bit, daily!

I was in so much hurry, that I didn’t read the complete stuff and simply following anything which I saw, one over the other.

Because of this I spent last night just doing it, no hurry. I was so much irritated. One or the other error! It was killing.

But yes finally I am done with this. Hurray! 😀

This blog post will guide you through, how to make and push your first jekyll site and host it on GitHub.

 Step One— Install Ruby with RVM

Run a quick update to make sure that all of the packages we download are up to date


sudo apt-get update

Installing RVM (Ruby Version Manager).

This is a awesome program that lets you use several versions of Ruby on one server; however, in this case, we will use it to install the 1.9.3 patched 125 of Ruby. You can use it for any version.

You can install it by following some of these steps.

I used the following steps:

If you do not have curl on your system, you can start by installing it:


sudo apt-get install curl

To install RVM, open terminal and type in this command:


\curl -L https://get.rvm.io | bash -s stable

After installing it, load RVM. First exit out of your shell session and start up a new one.


source ~/.rvm/scripts/rvm

RVM has some of its own dependencies that need to be installed. To automatically install them:


rvm requirements

 

 

It may ask for your root password to allow the installation of these dependencies.

Step Two—Install Ruby

You can use these steps, if you are installing for the first time. I messed up so I needed a reinstallation using rvm.


rvm reinstall ruby-1.9.3-p125

 

 

It may require you to do this:


rvm reinstall all --force

Set it as default:


rvm use ruby-1.9.3-p125 --default

 

If you get an error like

It seems your ruby installation is missing psych (for YAML output). To eliminate this warning, please install libyaml and reinstall your ruby.

go ahead and install libyaml using rvm.

If you don’t have libtool, first install it:


sudo apt-get install libtool

rvm pkg install libyaml

You need to reinstall Ruby


rvm reinstall ruby-1.9.3-p125

If you are still facing this error, give it a path:


rvm reinstall 1.9.3 --with-libyaml-dir=/home/user_name/.rvm/usr

 

You can keep checking, what you are installing by checking their versions:


ruby -v #check ruby version installed

gem -v #check gem version installed

bundler -v

jekyll -v

Additional gems can add features to Jekyll, such as the github-pages gem which bundles together several gems supported by Github Pages.

Install github-pages gem using:


sudo gem install github-pages --no-rdoc --no-ri

You can go ahead with the setup for Jekyll here.

 

After all the setup, let’s start pushing it and making it live.

1. Create a Repo, I have named it Must-Read.

2. Create a new jekyll site


jekyll new Must-Read

cd Must-Read

3. Initialize the above site created.


git init

#create the README

touch README.md

#add it

git add README.md

#add the remote

git remote add origin git@github.com:tapasweni-pathak/Must-Read.git

#push it

git push origin master

 

4. Change entries in _config.yml

As I already have github user page, so I created a project page. This is how you assign base-url and url, if you are doing the same for others link is attached below.


baseurl: "http://tapasweni-pathak.github.io/Must-Read/

url: "http://tapasweni-pathak.github.io"

5. Let’s push the site and make it live


#create branch gh-pages and switch to it

git checkout -b gh-pages

#check your current branch, it should be gh-pages

git branch

#push your new branch

git push origin gh-pages

Now change the branch in GitHub Repo UI.

Push the contents of your site


#add all contents of the jekyll you created

git add -A

#commit it

git commit -m 'Hello Jekyll'

#push it on branch gh-pages

git push origin gh-pages

Now you can check it live like this.

 

Some more links that can help you.

 

So now as you started pushed and made it live. You can go ahead and explore some of these themes and use them. 🙂

Advertisements

One thought on “Pushing Your First Jekyll Site On GitHub

  1. Thanks a lot for that, being a novice I’m trying my hands with it too. By the way, we both had co-incidentally chosen the same WordPress theme (though I’m going to post entries soon).
    Will be following your blog for great updates! 🙂

    Liked by 1 person

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s