#Step 1: Install rvm
安装rvm, 通过rvm可以安装多种版本的ruby,并且可以方便的改变当前要使用的版本
1 2 3 4 5
| //install curl sudo apt-get install curl //instal rvm script curl -sSL https://get.rvm.io | bash -s stable
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| //会产生一下内容 Downloading https://github.com/wayneeseguin/rvm/archive/stable.tar.gz Installing RVM to /home/andrew-liu/.rvm/ Adding rvm PATH line to /home/andrew-liu/.profile /home/andrew-liu/.bashrc /home/andrew-liu/.zshrc. Adding rvm loading line to /home/andrew-liu/.bash_profile /home/andrew-liu/.zlogin. Fixing environment for *. Unknown ruby interpreter version (do not know how to handle): *. Installation of RVM in /home/andrew-liu/.rvm/ is almost complete: * To start using RVM you need to run `source /home/andrew-liu/.rvm/scripts/rvm` in all your open shell windows, in rare cases you need to reopen all shell windows. # andrew-liu, # # 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 /home/andrew-liu/.zshrc:54:export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games" * WARNING: Above files contains `PATH=` with no `$PATH` inside, this can break RVM, for details check https://github.com/wayneeseguin/rvm/issues/1351#issuecomment-10939525 to avoid this warning append #PATH.
|
#Step 2: Set RVM environment
配置环境变量
运行以后命令
1 2 3
| //其中username要更改为当前用户使用的主目录 //可以通过 cd ~进入当前用户工作目录 source /home/username/.rvm/scripts/rvm
|
#Step 3: Install latest available ruby version
首先安装ruby的环境依赖项
用下面的命令安装最新版本的ruby, 当前最新版本为2.12
获取ruby当前可用最新版本
1 2
| //install ruby rvm install 2.1.2
|
#Step 4: Select default version to be used
选取一个ruby版本当做被使用的默认版本
#Step 5: Install nodejs
安装nodejs到ubuntu系统中(如果你发现javascript运行错误, 最可能是因为缺少nodejs库)
1
| sudo apt-get install nodejs
|
#Step 6: Install Jekyll
使用gem命令安装jekyll,默认会安装jekyll2.0版本, 这是当前的最新版本
1 2 3
| gem install jekyll //下面的命令可以在安装好jekyll后查看其版本 jekyll -v
|
#Step 7: Create blog and up the server
现在我们准备去创建blog并运行服务器。
下面的命令创建一个blog目录, 可以取自己想取的名字, 在这个目录中jekyll已经自动生成了配置文件和安装文件
Run the Jekyll Server:
#Step 8: Open blog on web browser
打开浏览器,并使用以下的url