git github jekyll
1.安装Ruby和RubyGems:
##sudo apt-get install ruby-full rubygems
#Ruby依赖库安装
sudo apt-get install -y build-essential openssl curl libcurl3 libcurl3-dev libreadline6 libreadline6-dev git zlib1g zlib1g-dev libssl-dev libyaml-dev libxml2-dev libxslt-dev autoconf automake libtool imagemagick libmagickwand-dev libpcre3-dev libsqlite3-dev
############RVM和源码安装,推荐RVM安装############
####源码编译安装Ruby####
wget http://ruby.taobao.org/mirrors/ruby/ruby-1.9.2-p320.tar.gz
tar -zxvf ruby-1.9.2-p320.tar.gz
cd /opt/ruby/ruby-1.9.2-p320
./configure --prefix=/usr/local/ruby
sudo make && sudo make install
#添加环境变量
export RUBY_HOME=/usr/local/ruby
export PATH=$RUBY_HOME/bin:$PATH
#创建关联
sudo ln -s /opt/ruby/ruby-1.9.2/bin/ruby /usr/local/bin/ruby
sudo ln -s /opt/ruby/ruby-1.9.2/bin/gem /usr/bin/gem
####RVM安装Ruby####
#安装RVM:
curl -L https://get.rvm.io | bash -s stable
载入RVM环境:source ~/.rvm/scripts/rvm
测试安装:rvm -v
#安装后root默认是无效需输入:su - root
####RVM安装Ruby####
#切换Ruby下载地址到淘宝镜像-没成功
sed -i .bak 's!ftp.ruby-lang.org/pub/ruby!ruby.taobao.org/mirrors/ruby!' $rvm_path/config/db
#安装readline包
rvm pkg install readline
#安装Ruby1.9.2
rvm install 1.9.2-p320 --with-readline-dir=$rvm_path/usr
#指下Ruby默认版本
rvm 1.9.2 --default
#测试安装:ruby -v gem -v
#卸载ruby;
sudo apt-get purge ruby
which gem gem1.8
rm -r /usr/local/bin/gem
rm -r /usr/bin/gem1.8
#更新RubyGems:
sudo su
export REALLY_GEM_UPDATE_SYSTEM=true
gem update --system
exit
#安装RubyGems:
进入http://rubyforge.org/frs/?group_id=126获取RubyGems
ruby setup.rb
#Rails安装
gem install bundler rails
安装测试:bundle -v rails -v
参考:ruby wiki
2.安装Jekyll
gem install jekyll
GitHub上创建仓库:USERNAME.github.com
安装Jekyll-Bootstrap:
git clone https://github.com/plusjade/jekyll-bootstrap.git USERNAME.github.com
cd USERNAME.github.com
git remote set-url origin git@github.com:USERNAME/USERNAME.github.com.git
git push origin master
安装rake:
sudo gem install rake
配置_config.yml:#设置博客的常规信息及常用功能[评论、跟踪]
rake post title="Hello World" #创建帖子
rake page name="about.markdown"#创建页面
rake page name="pages/about.md"#创建嵌套页面
启动:jekyll --server
参考:
jekyll bootstrap
Jekyll建站之旅
Github+Jekyll构建个人博客
jekyll集
html5 jekyll
github搭建个人博客