Jekyll is a static site generator, ruby based free software. It is written by Tom Priston Werner , GitHub’s cofounder.
In this post we will install the latest jekyll 2.0 version. Whereas the steps are applicable to previous version(Jekyll 1.0) also
By using jekyll you can create awesome blogs, writing the post and pages in markdown language and it do not require any Database[mysql,sql,mongo etc.]. It is a file based CMS,the markdown files are generated in html format.
Within a few minutes you can install Jekyll and run your website/blog .
In our previous post we have already describe about installation of octopress on CentOS and Ubuntu(Octopress is framework based on Jekyll) . For ruby installation we will use same process that is with RVM.
Steps to install Jekyll on Ubuntu 14.04 LTS
Follow the given below steps to install jekyll on Ubuntu.
Step 1: Install rvm
Run the below given command to install rvm. The benefit of rvm is,through this we can install multiple ruby version and switch to previous and latest available version on our system.
Install curl:
sudo apt-get install curl
Install rvm script:
curl -sSL https://get.rvm.io | bash -s stable
IMPORTANT : Read the below given reference from my system. It helps you to understand to do next step. Here, my user name is sharad
sharad@ubuntu:~$ curl -sSL https://get.rvm.io | bash -s stable Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz Installing RVM to /home/sharad/.rvm/ Adding rvm PATH line to /home/sharad/.profile /home/sharad/.bashrc /home/sharad/.zshrc. Adding rvm loading line to /home/sharad/.bash_profile /home/sharad/.zlogin. Installation of RVM in /home/sharad/.rvm/ is almost complete: * To start using RVM you need to run `source /home/sharad/.rvm/scripts/rvm` in all your open shell windows, in rare cases you need to reopen all shell windows. # sharad, # # Thank you for using RVM! # We sincerely hope that RVM helps to make your life easier and more enjoyable!!! # # ~Wayne, Michal & team. In case of problems: http://rvm.io/help and https://twitter.com/rvm_io sharad@ubuntu:~$
Step 2: Set RVM environment
From Step 1 you will get reference, what absolute path of script to be used with source
command .
In above reference, read this line –
To start using RVM you need to run `source /home/sharad/.rvm/scripts/rvm` in all your open shell windows
Hence, I am running below given command. In your system, find this line and run it on your system
source /home/sharad/.rvm/scripts/rvm
Step 3: Install latest available ruby version
First install ruby requirements. run below given command
rvm requirements
Use below given command and write down the latest availbale ruby version instead of 2.1.2
at the time of writing this post, ruby version 2.1.2 is latest. (Get information from Ruby Download link)
Install latest ruby version:
rvm install 2.1.2
Step 4: Select default version to be used
The below given command helps to set default ruby version. Here, ruby version 2.1.2 is selected as default
rvm use 2.1.2 --default
Step 5: Install nodejs
Install nodejs in Ubuntu system . (If you face javascript runtime error, most probably because of absence of nodejs package)
sudo apt-get install nodejs
Step 6: Install Jekyll
We will simply use the gem command to install Jekyll. And by defualt it will install Jekyll 2.0 version ,which is latest at present.
gem install jekyll
You can check jekyll version by using the command
jekyll -v
Step 7: Create blog and up the server
Now we are ready to create the blog and run the server
The below given command create the directory called mysiteblog. You can given another name of your choice. In this directory, jekyll configuration file and setup is all set.
jekyll new mysiteblog
Run the Jekyll Server:
Jekyll server listen at port number 4000 .
Change to newly created directory mysiteblog or the new name which you have given at the time of using command jekyll new blog-name
cd mysiteblog
Start jekyll server
jekyll serve
Step 8: Open blog on web browser
Now open the newly created blog on your system’s web browser.
Open the web browser and type the below given command
http://localhost:4000
The below given is reference from my site.
Now you can start blogging on Jekyll. The posts and pages to be write on Markdown.
Generate static files. You can also move your static site in AWS S3 bucket, it will be awesome,fast and economical as well.
Read Jekyll Documentation
Below given is complete reference from my system
I have already installed nodejs. Hence it is not included in below given section.
sharad@linuxworld:~/Desktop$ curl -sSL https://get.rvm.io | bash -s stable Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz Installing RVM to /home/sharad/.rvm/ Adding rvm PATH line to /home/sharad/.profile /home/sharad/.bashrc /home/sharad/.zshrc. Adding rvm loading line to /home/sharad/.bash_profile /home/sharad/.zlogin. Installation of RVM in /home/sharad/.rvm/ is almost complete: * To start using RVM you need to run `source /home/sharad/.rvm/scripts/rvm` in all your open shell windows, in rare cases you need to reopen all shell windows. # sharad, # # Thank you for using RVM! # We sincerely hope that RVM helps to make your life easier and more enjoyable!!! # # ~Wayne, Michal & team. In case of problems: http://rvm.io/help and https://twitter.com/rvm_io sharad@linuxworld:~/Desktop$ source /home/sharad/.rvm/scripts/rvm sharad@linuxworld:~/Desktop$ rvm requirements Checking requirements for ubuntu. Requirements installation successful. sharad@linuxworld:~/Desktop$ rvm install 2.1.2 Searching for binary rubies, this might take some time. Found remote file https://rvm.io/binaries/ubuntu/14.04/x86_64/ruby-2.1.2.tar.bz2 Checking requirements for ubuntu. Requirements installation successful. ruby-2.1.2 - #configure ruby-2.1.2 - #download % Total % Received % Xferd Average Speed Time Time Time Current Dload Upload Total Spent Left Speed 100 22.8M 100 22.8M 0 0 68673 0 0:05:48 0:05:48 --:--:-- 92951 No checksum for downloaded archive, recording checksum in user configuration. ruby-2.1.2 - #validate archive ruby-2.1.2 - #extract ruby-2.1.2 - #validate binary ruby-2.1.2 - #setup ruby-2.1.2 - #making binaries executable.. Rubygems 2.2.2 already available in installed ruby, skipping installation, use --force to reinstall. ruby-2.1.2 - #gemset created /home/sharad/.rvm/gems/ruby-2.1.2@global ruby-2.1.2 - #importing gemset /home/sharad/.rvm/gemsets/global.gems........................................ ruby-2.1.2 - #generating global wrappers......... ruby-2.1.2 - #gemset created /home/sharad/.rvm/gems/ruby-2.1.2 ruby-2.1.2 - #importing gemsetfile /home/sharad/.rvm/gemsets/default.gems evaluated to empty gem list ruby-2.1.2 - #generating default wrappers......... sharad@linuxworld:~/Desktop$ rvm use 2.1.2 --default Using /home/sharad/.rvm/gems/ruby-2.1.2 sharad@linuxworld:~/Desktop$ gem install jekyll Fetching: liquid-2.6.1.gem (100%) Successfully installed liquid-2.6.1 Fetching: fast-stemmer-1.0.2.gem (100%) Building native extensions. This could take a while... Successfully installed fast-stemmer-1.0.2 Fetching: classifier-1.3.4.gem (100%) Successfully installed classifier-1.3.4 Fetching: kramdown-1.4.0.gem (100%) Successfully installed kramdown-1.4.0 Fetching: posix-spawn-0.3.8.gem (100%) Building native extensions. This could take a while... Successfully installed posix-spawn-0.3.8 Fetching: yajl-ruby-1.1.0.gem (100%) Building native extensions. This could take a while... Successfully installed yajl-ruby-1.1.0 Fetching: pygments.rb-0.6.0.gem (100%) Successfully installed pygments.rb-0.6.0 Fetching: mercenary-0.3.3.gem (100%) Successfully installed mercenary-0.3.3 Fetching: safe_yaml-1.0.3.gem (100%) Successfully installed safe_yaml-1.0.3 Fetching: colorator-0.1.gem (100%) Successfully installed colorator-0.1 Fetching: redcarpet-3.1.2.gem (100%) Building native extensions. This could take a while... Successfully installed redcarpet-3.1.2 Fetching: blankslate-2.1.2.4.gem (100%) Successfully installed blankslate-2.1.2.4 Fetching: parslet-1.5.0.gem (100%) Successfully installed parslet-1.5.0 Fetching: toml-0.1.1.gem (100%) Successfully installed toml-0.1.1 Fetching: jekyll-paginate-1.0.0.gem (100%) Successfully installed jekyll-paginate-1.0.0 Fetching: jekyll-gist-1.1.0.gem (100%) Successfully installed jekyll-gist-1.1.0 Fetching: coffee-script-source-1.7.0.gem (100%) Successfully installed coffee-script-source-1.7.0 Fetching: execjs-2.2.1.gem (100%) Successfully installed execjs-2.2.1 Fetching: coffee-script-2.2.0.gem (100%) Successfully installed coffee-script-2.2.0 Fetching: jekyll-coffeescript-1.0.0.gem (100%) Successfully installed jekyll-coffeescript-1.0.0 Fetching: sass-3.3.9.gem (100%) Successfully installed sass-3.3.9 Fetching: jekyll-sass-converter-1.0.0.gem (100%) Successfully installed jekyll-sass-converter-1.0.0 Fetching: ffi-1.9.3.gem (100%) Building native extensions. This could take a while... Successfully installed ffi-1.9.3 Fetching: rb-inotify-0.9.5.gem (100%) Successfully installed rb-inotify-0.9.5 Fetching: rb-fsevent-0.9.4.gem (100%) Successfully installed rb-fsevent-0.9.4 Fetching: hitimes-1.2.1.gem (100%) Building native extensions. This could take a while... Successfully installed hitimes-1.2.1 Fetching: timers-3.0.1.gem (100%) Successfully installed timers-3.0.1 Fetching: celluloid-0.16.0.pre2.gem (100%) Successfully installed celluloid-0.16.0.pre2 Fetching: listen-2.7.9.gem (100%) Successfully installed listen-2.7.9 Fetching: jekyll-watch-1.0.0.gem (100%) Successfully installed jekyll-watch-1.0.0 Fetching: jekyll-2.1.0.gem (100%) Successfully installed jekyll-2.1.0 Parsing documentation for blankslate-2.1.2.4 Installing ri documentation for blankslate-2.1.2.4 Parsing documentation for celluloid-0.16.0.pre2 Installing ri documentation for celluloid-0.16.0.pre2 Parsing documentation for classifier-1.3.4 Installing ri documentation for classifier-1.3.4 Parsing documentation for coffee-script-2.2.0 Installing ri documentation for coffee-script-2.2.0 Parsing documentation for coffee-script-source-1.7.0 Installing ri documentation for coffee-script-source-1.7.0 Parsing documentation for colorator-0.1 Installing ri documentation for colorator-0.1 Parsing documentation for execjs-2.2.1 Installing ri documentation for execjs-2.2.1 Parsing documentation for fast-stemmer-1.0.2 Installing ri documentation for fast-stemmer-1.0.2 Parsing documentation for ffi-1.9.3 Installing ri documentation for ffi-1.9.3 Parsing documentation for hitimes-1.2.1 Installing ri documentation for hitimes-1.2.1 Parsing documentation for jekyll-2.1.0 Installing ri documentation for jekyll-2.1.0 Parsing documentation for jekyll-coffeescript-1.0.0 Installing ri documentation for jekyll-coffeescript-1.0.0 Parsing documentation for jekyll-gist-1.1.0 Installing ri documentation for jekyll-gist-1.1.0 Parsing documentation for jekyll-paginate-1.0.0 Installing ri documentation for jekyll-paginate-1.0.0 Parsing documentation for jekyll-sass-converter-1.0.0 Installing ri documentation for jekyll-sass-converter-1.0.0 Parsing documentation for jekyll-watch-1.0.0 Installing ri documentation for jekyll-watch-1.0.0 Parsing documentation for kramdown-1.4.0 Installing ri documentation for kramdown-1.4.0 Parsing documentation for liquid-2.6.1 Installing ri documentation for liquid-2.6.1 Parsing documentation for listen-2.7.9 Installing ri documentation for listen-2.7.9 Parsing documentation for mercenary-0.3.3 Installing ri documentation for mercenary-0.3.3 Parsing documentation for parslet-1.5.0 Installing ri documentation for parslet-1.5.0 Parsing documentation for posix-spawn-0.3.8 Installing ri documentation for posix-spawn-0.3.8 Parsing documentation for pygments.rb-0.6.0 Installing ri documentation for pygments.rb-0.6.0 Parsing documentation for rb-fsevent-0.9.4 Installing ri documentation for rb-fsevent-0.9.4 Parsing documentation for rb-inotify-0.9.5 Installing ri documentation for rb-inotify-0.9.5 Parsing documentation for redcarpet-3.1.2 Installing ri documentation for redcarpet-3.1.2 Parsing documentation for safe_yaml-1.0.3 Installing ri documentation for safe_yaml-1.0.3 Parsing documentation for sass-3.3.9 Installing ri documentation for sass-3.3.9 Parsing documentation for timers-3.0.1 Installing ri documentation for timers-3.0.1 Parsing documentation for toml-0.1.1 Installing ri documentation for toml-0.1.1 Parsing documentation for yajl-ruby-1.1.0 Installing ri documentation for yajl-ruby-1.1.0 Done installing documentation for blankslate, celluloid, classifier, coffee-script, coffee-script-source, colorator, execjs, fast-stemmer, ffi, hitimes, jekyll, jekyll-coffeescript, jekyll-gist, jekyll-paginate, jekyll-sass-converter, jekyll-watch, kramdown, liquid, listen, mercenary, parslet, posix-spawn, pygments.rb, rb-fsevent, rb-inotify, redcarpet, safe_yaml, sass, timers, toml, yajl-ruby after 25 seconds 31 gems installed sharad@linuxworld:~/Desktop$ sharad@linuxworld:~/Desktop$ jekyll new mysiteblog New jekyll site installed in /home/sharad/Desktop/mysiteblog. sharad@linuxworld:~/Desktop$ sharad@linuxworld:~/Desktop$ cd mysiteblog/ sharad@linuxworld:~/Desktop/mysiteblog$ sharad@linuxworld:~/Desktop/mysiteblog$ jekyll serve Configuration file: /home/sharad/Desktop/mysiteblog/_config.yml Source: /home/sharad/Desktop/mysiteblog Destination: /home/sharad/Desktop/mysiteblog/_site Generating... done. Configuration file: /home/sharad/Desktop/mysiteblog/_config.yml Server address: http://0.0.0.0:4000/ Server running... press ctrl-c to stop.
Awesome work bro. Nice and Tidy.
Thankyou!
Regards
Sharad
Nice Tutorial ,helped a lot .Thanks!
Thank you for giving positive feedback!
Regards
Sharad
You rock man! Even stackoverflow didn’t have such a detailed tutorial.. hats off
Thank You Arkya 🙂
Regards
Sharad
Thank you for your post, it helps me
Welcome Pavel,
Regards
Sharad
You are the best. Been stuck on this for awhile. Thanks!
Thank You Shane,
Regards
Sharad
Thanks a ton, Since three days, i was not able to install jekyll. The following error was seen –
cannot load such file — zlibERROR: While executing gem … (NoMethodError)
Finally i un installed all rubies and by following steps mentioned by you,nstallation is successful.
Hello Shyam,
Really appreciate because such feedback is very important for any tutorial. It raise the trust in readers and confidence in authors to share as much as possible useful post for all.
Awesome blossom and have a great rocking geeky days ahead.
Regards
Sharad
Excellent tutorial. Thanks a bunch!
Thank you Adrian,
Regards
Sharad
Hi I like this how to install Jekyll but due to some reasons I want to know that how to uninstall or remove RVM script cause I made some mistakes for that I gotta re-install it or I have re-install Ubuntu LOL..
Are you Indian? Coz I’m
Hello Ashutosh,
Always remember when we install rvm it also create executable PATH environment in many files. In our post you can see the reference at Step 1.
1.
rvm implode
2.
gem uninstall rvm
3. Remove the rvm and .rvm directory
You can find rvm and .rvm directory by using find command
sudo find / -name rvm
sudo find / -name .rvm
4. Check .bash_profile , .bashrc and other files where ever rvm PATH environment is set. And remove the rvm environment.
Regards
Sharad