Recently, I want to build a personal blog by myself. I initially plan to use Github page and Operation. Now I will record the process of building and the problems encountered to help other friends.

1. Install Git

I don’t want to talk too much about this

2. Build a Ruby environment

Operation official website requires the Ruby version to be at least 1.9.3. You can run the following terminal command to view the installed Ruby version

 ruby –version

If you do not have the appropriate Ruby installed, you can choose three methods. One is to directly download the Ruby package from the official website, unzip it, and install it. The other is to use RVM(Ruby Version Manager) or Rbenv to install and manage Ruby’s environment.

A. Go to the official website to download the Ruby package, unzip it, and install it

https://www.ruby-lang.org/en/

B. Use RVM to install and manage Ruby’s environment


You can refer to: octopress.org/docs/setup/…

(1) install RVM:

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

Install Ruby 1.9.3:

RVM install 1.9.3

RVM use 1.9.3

rvm rubygems latest

C. Use Rbenv to install and manage Ruby’s environment


You can refer to: octopress.org/docs/setup/…

(1) Install Rbenv:

cd

git clone git://github.com/sstephenson/rbenv.git .rbenv

echo ‘export PATH=”$HOME/.rbenv/bin:$PATH”‘ >> ~/.bash_profile

echo ‘eval “$(rbenv init -)”‘ >> ~/.bash_profile

git clone git://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

source ~/.bash_profile

If you want to install Rbenv using Homebrew, you can execute the following command:

brew update

brew install rbenv

brew install ruby-build

(2) Installation: Ruby 1.9.3

Rbenv install 1.9.3 – p0

Rbenv local 1.9.3 – p0

rbenv rehash

Octopress

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

cd octopress

Gem install Bundler

bundle install

If an error occurs when installing a dependent component

While executing gem … (Gem::FilePermissionError)

You don’t have write permissions for the /Library/Ruby/Gems/2.0.0 directory

That’s because of permissions. You can use gem install bundler instead:

sudo gem install bundler

If still error:

While executing gem … (Errno::EPERM)

Operation not permitted – /usr/bin/bundle

This is because the SIP protection policy in EI system needs to be modified GEM_HOME. You can run the following command:

sudo gem install bundler -n /usr/local/bin

4. Install the default Octopuses theme

rake install

Octopuses

Yml is the configuration _config.yml, you can use the text editor to open the direct modification, specific how to modify the official website has been very detailed!

Reference: octopress.org/docs/config…

Octopuses on Github

Create a repository on GitHub and name the repository as username.github. Stay after release can be used directly to access the blog http://username.github.io (note cannot use the HTTPS protocol, must use the HTTP protocol)