Setting Up Octopress-BLOGGING FRAMEWORK

Protected by Copyscape Web Plagiarism Tool

You should be comfortable running shell commands and familiar with the basics of GIT. GIT is a distributed Version Control System(VCS). This allows non-linear development of projects and can handle large amount of data effectively by storing it on Local Server.

Step 1: Install Git

1
$ sudo apt-get install git

sudo –> for administrative previlages.

apt-get-> Package Installer, puts stuff from repositries and install them.

Now it’s time to configure your settings. To do this you need to open an app called Terminal.

  • USERNAME :– First you need to tell git your name, so that it can properly label the commits you make.
1
2
$ git config --global user.name "Your Name Here"
  # Sets the default name for git to use when you commit
  • E-Mail :– Git saves your email address into the commits you make. We use the email address to associate your commits with your GitHub account.
1
2
$ git config --global user.email "your_email@example.com"
  # Sets the default email for git to use when you commit
  • To see all settings :–
1
$ git config --list

Step 2: Install RVM

RVM is Ruby Version Manager.It allows us to install and manage different versions and implementations of ruby on one computer including ability to manage different sets of Ruby gems on each.Thus, allowing to test our application with different versions of ruby setups.

Run the following command from your terminal.Be sure to follow any subsequent instructions as guided by the installation process.

1
$ curl -L https://get.rvm.io | bash -s stable --ruby

The above command will install both RVM and the latest version of Ruby. curl is a client to get document/file or send to server using any of supported protocols.

If the above command produces an error, run following command from ypur terminal to achieve the same.

1
$ wget --no-check-certificate https://raw.github.com/joshfng/railsready/master/railsready.sh && bash railsready.sh # You, will be asked to choose option (Enter your choice as 1)

Step 3: Install Ruby 1.9.3

1
2
3
$ rvm install 1.9.3
  $ rvm use 1.9.3
  $ rvm rubygems latest

Gems contain package information along with files to install RubyGems.It is a package manager which became part of the standard library in Ruby 1.9. It allows developers to search,install and build gems, among other features. All of this is done by using the gem command-line utility.

  • Run ruby – -version to be sure you’re using Ruby 1.9.3. If you’re having trouble, run the following command on your terminal to set your default version of ruby-1.9.3
1
$ rvm --default use ruby-1.9.3-p429

If ruby —version doesn’t say you’re using Ruby 1.9.3, revisit your RVM installation.

Step 4: Setup Octopress

1
$ git clone git://github.com/imathis/octopress.git octopress

The above command replaces octopress with username.github.com.

  • Next we need to change current working directory to octopress.
1
2
$ cd octopress    # You'll be asked if you trust the .rvmrc file (say yes).
  ruby --version  # Should report Ruby 1.9.3
  • Next, install dependencies.

Using Bundler to manage your gem’s dependencies is also pretty easy.Bundler is a program for managing gem dependencies in your Ruby projects. With Bundler you can specify which gems your program needs.

1
$ gem install bundler

This should be the only gem you need to install yourself should all your programs’ dependencies be managed by Bundler.

  • Now,Install the dependencies specified in your Gemfile
1
$ bundle install
  • Install the default Octopress theme.
1
$rake install

Rake is a Make-like program implemented in Ruby. Tasks and dependencies are specified in standard Ruby syntax. A rake file is a collection of tasks, when you call rake with an argument (in this case install) that’s the task that get’s executed.

Step 5: Deploying with Github User/Organization Pages

  • Creating Github User/Organization Pages

    • Create a new Github repository and name the repository with your username.github.com or organization.github.com.

    • Switch over to new repository created in previous step. Click on Settings Tab , scroll down to Github pages and click on “Automatic Page generator” button.

    • Author your content in the Markdown editor.

    • Click the Continue To Layouts button.

    • Preview your content in our themes.

    • When you find a theme that you like, click Publish

  • Generating SSH – keys

We can use SSH keys to establish a secure connection between your computer and GitHub. To generate a new SSH key, enter the code below. We want the default settings so when asked to enter a file in which to save the key, just press enter

1
2
3
4
$ssh-keygen -t rsa -C "your_email@example.com"
   # Creates a new ssh key, using the provided email as a label
  # Generating public/private rsa key pair.
  # Enter file in which to save the key (/home/you/.ssh/id_rsa):

Now you need to enter a passphrase.

1
2
Enter passphrase (empty for no passphrase): [Type a passphrase]
    # Enter same passphrase again: [Type passphrase again]
1
2
3
4
Your identification has been saved in /home/you/.ssh/id_rsa.
 # Your public key has been saved in /home/you/.ssh/id_rsa.pub.
 # The key fingerprint is:
 # 01:0f:f4:3b:ca:85:d6:17:a1:7d:f0:68:9d:f0:a2:db    your_email@example.com
  • Add your SSH -key to GitHub

    • Go to your Account Settings.

    • Click “SSH Keys” in the left sidebar.

    • Click “Add SSH key”
    • Paste your key into the “Key” field.
    • Click “Add key”.
    • Confirm the action by entering your GitHub password.

To make sure everything is working you’ll now SSH to GitHub. When you do this, you will be asked to authenticate this action using your password, which for this purpose is the passphrase you created earlier.

1
2
$ssh -T git@github.com
 # Attempts to ssh to github

You may see this warning:

1
2
3
# The authenticity of host 'github.com (207.97.227.239)' can't be established.
 # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
 # Are you sure you want to continue connecting (yes/no)?

Don’t worry, this is supposed to happen. Verify that the fingerprint matches the one here and type “yes”.

1
2
# Hi username! You've successfully authenticated, but GitHub does not
 # provide shell access.

If that username is correct, you’ve successfully set up your SSH key. Don’t worry about the shell access thing, you don’t want that anyway. If Not correct ,To Add Authenticity and again check Authenticity.

1
ssh-add
  • Github Pages for users and organizations uses the master branch like the public directory on a web server, serving up the files at your Pages . As a result, you’ll want to work on the source for your blog in the source branch and commit the generated content to the master branch. Octopress has a configuration task that helps you set all this up.
1
$rake setup_github_pages
  • This will Ask you for your Github Pages repository url.

  • Next run: This will generate your blog, copy the generated files into _deploy/, add them to git, commit and push them up to the master branch. In a few seconds you should get an email from Github telling you that your commit has been received and will be published on your site.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$git init
      $rake generate
      $rake deploy
      $rake preview
      $git add .
      $git remote show origin
      $git remote show octopress
      $git remote rm octopress
      $git remote rm origin
      $git remote add origin git@github.com:your_user_name/your_user_name.github.io.git
      $git remote -v
      $git pull origin source
      $ git add .
      $git commit -m "comment"
      $git push origin source
      $rake deploy