注意:以下步骤是翻墙后操作的,需要了解翻墙的可以移步 -> 枫叶主机

一、安装jekyll需要Ruby-2.1.0以上版本,本人是mac pro系统版本10.12.5(macOS Sierra),系统内置的Ruby是2.0.0。

  1、安装RVM

    RVM: Ruby Version Manager, Ruby的版本管理器,包括Ruby的版本管理和Gem库管理(gemset);

     $ curl -L get.rvm.io | bash -s stable

  2、验证是否安装成功

   $ source ~/.bashrc

   $ source ~/.bash_profile

二、安装home-brew(切记先安装home-brew,再安装ruby!!)

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

三、安装Ruby

  1、查看当前版本

youcanpingdeMacBook-Pro:~ issuser$ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin16]

  2、查看rvm中的ruby可以升级的版本

youcanpingdeMacBook-Pro:~ issuser$ rvm list known
# MRI Rubies
[ruby-]1.8.6[-p420]
[ruby-]1.8.7[-head] # security released on head
[ruby-]1.9.1[-p431]
[ruby-]1.9.2[-p330]
[ruby-]1.9.3[-p551]
[ruby-]2.0.0[-p648]
[ruby-]2.1[.10]
[ruby-]2.2[.7]
[ruby-]2.3[.4]
[ruby-]2.4[.1]
ruby-head

  3、我升级Ruby到最新用ruby-head,安装过程中会安装需要的依赖包。

youcanpingdeMacBook-Pro:~ issuser$ rvm install ruby-head
Checking requirements for osx.
Installing requirements for osx.
Updating system.........
Installing required packages: openssl@1.1...
Certificates bundle '/usr/local/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/issuser/.rvm/rubies/ruby-head, this may take a while depending on your cpu(s)...
Cloning from https://github.com/ruby/ruby.git, this may take a while depending on your connection/
.
HEAD is now at 6ee82564fa stringio.c: encoding at EOF
From https://github.com/ruby/ruby
* branch trunk -> FETCH_HEAD
Already up-to-date.
git checkout trunk
Copying from repo to src path...
ruby-head - #autoreconf.
ruby-head - #configuring.......................................................|
ruby-head - #post-configuration.
ruby-head - #compiling.........................................................|
ruby-head - #installing.........
ruby-head - #making binaries executable..
Installed rubygems 2.6.12 is newer than ignore provided with installed ruby, skipping installation, use --force to force installation.
ruby-head - #gemset created /Users/issuser/.rvm/gems/ruby-head@global
ruby-head - #importing gemset /Users/issuser/.rvm/gemsets/global.gems...........
ruby-head - #generating global wrappers........
ruby-head - #gemset created /Users/issuser/.rvm/gems/ruby-head
ruby-head - #importing gemsetfile /Users/issuser/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-head - #generating default wrappers........
ruby-head - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-head - #complete
Ruby was built without documentation, to build it run: rvm docs generate-ri
youcanpingdeMacBook-Pro:~ issuser$

  4、查看当前ruby版本是否变为ruby-2.2.4,如果没变就执行 rvm use ruby-2.2.4,在查看版本就是最新的了

youcanpingdeMacBook-Pro:~ issuser$ ruby -v
ruby 2.5.0dev (2017-08-12 trunk 59578) [x86_64-darwin16]
youcanpingdeMacBook-Pro:~ issuser$ rvm use ruby-head
Using /Users/issuser/.rvm/gems/ruby-head

  5、安装ruby报如下错

Searching for binary rubies, this might take some time. No binary rubies available for: osx/10.10/x86_64/ruby-2.1.5. Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies. Checking requirements for osx. Installing requirements for osx. Updating system.......... Installing required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libksba, openssl...... Error running 'requirements_osx_brew_libs_install autoconf automake libtool pkg-config libyaml readline libksba openssl', showing last 15 lines of /Users/wjf/.rvm/log/1417267175_ruby-2.1.5/package_install_autoconf_automake_libtool_pkg-config_libyaml_readline_libksba_openssl.log ++ case "$1" in ++ [[ -t 1 ]] ++ return 1 ++ printf %b 'There were package installation errors, make sure to read the log.

  解决方法,安装xcode命令行工具,如果已有则升级到最新

$ xcode-select --install

四、安装jekyll

youcanpingdeMacBook-Pro:~ issuser$ gem install jekyll
Fetching: public_suffix-2.0.5.gem (100%)
Successfully installed public_suffix-2.0.5
Fetching: addressable-2.5.1.gem (100%)
Successfully installed addressable-2.5.1
Fetching: colorator-1.1.0.gem (100%)
Successfully installed colorator-1.1.0
Fetching: rb-fsevent-0.10.2.gem (100%)
Successfully installed rb-fsevent-0.10.2
Fetching: ffi-1.9.18.gem (100%)
Building native extensions. This could take a while...
Successfully installed ffi-1.9.18
Fetching: rb-inotify-0.9.10.gem (100%)
Successfully installed rb-inotify-0.9.10
Fetching: sass-listen-4.0.0.gem (100%)
Successfully installed sass-listen-4.0.0
Fetching: sass-3.5.1.gem (100%)
Successfully installed sass-3.5.1
Fetching: jekyll-sass-converter-1.5.0.gem (100%)
Successfully installed jekyll-sass-converter-1.5.0
Fetching: listen-3.0.8.gem (100%)
Successfully installed listen-3.0.8
Fetching: jekyll-watch-1.5.0.gem (100%)
Successfully installed jekyll-watch-1.5.0
Fetching: kramdown-1.14.0.gem (100%)
Successfully installed kramdown-1.14.0
Fetching: liquid-4.0.0.gem (100%)
Successfully installed liquid-4.0.0
Fetching: mercenary-0.3.6.gem (100%)
Successfully installed mercenary-0.3.6
Fetching: forwardable-extended-2.6.0.gem (100%)
Successfully installed forwardable-extended-2.6.0
Fetching: pathutil-0.14.0.gem (100%)
Successfully installed pathutil-0.14.0
Fetching: rouge-1.11.1.gem (100%)
Successfully installed rouge-1.11.1
Fetching: safe_yaml-1.0.4.gem (100%)
Successfully installed safe_yaml-1.0.4
Fetching: jekyll-3.5.1.gem (100%)
Successfully installed jekyll-3.5.1
Parsing documentation for public_suffix-2.0.5
Installing ri documentation for public_suffix-2.0.5
Parsing documentation for addressable-2.5.1
Installing ri documentation for addressable-2.5.1
Parsing documentation for colorator-1.1.0
Installing ri documentation for colorator-1.1.0
Parsing documentation for rb-fsevent-0.10.2
Installing ri documentation for rb-fsevent-0.10.2
Parsing documentation for ffi-1.9.18
Installing ri documentation for ffi-1.9.18
Parsing documentation for rb-inotify-0.9.10
Installing ri documentation for rb-inotify-0.9.10
Parsing documentation for sass-listen-4.0.0
Installing ri documentation for sass-listen-4.0.0
Parsing documentation for sass-3.5.1
Installing ri documentation for sass-3.5.1
Parsing documentation for jekyll-sass-converter-1.5.0
Installing ri documentation for jekyll-sass-converter-1.5.0
Parsing documentation for listen-3.0.8
Installing ri documentation for listen-3.0.8
Parsing documentation for jekyll-watch-1.5.0
Installing ri documentation for jekyll-watch-1.5.0
Parsing documentation for kramdown-1.14.0
Installing ri documentation for kramdown-1.14.0
Parsing documentation for liquid-4.0.0
Installing ri documentation for liquid-4.0.0
Parsing documentation for mercenary-0.3.6
Installing ri documentation for mercenary-0.3.6
Parsing documentation for forwardable-extended-2.6.0
Installing ri documentation for forwardable-extended-2.6.0
Parsing documentation for pathutil-0.14.0
Installing ri documentation for pathutil-0.14.0
Parsing documentation for rouge-1.11.1
Installing ri documentation for rouge-1.11.1
Parsing documentation for safe_yaml-1.0.4
Installing ri documentation for safe_yaml-1.0.4
Parsing documentation for jekyll-3.5.1
Installing ri documentation for jekyll-3.5.1
Done installing documentation for public_suffix, addressable, colorator, rb-fsevent, ffi, rb-inotify, sass-listen, sass, jekyll-sass-converter, listen, jekyll-watch, kramdown, liquid, mercenary, forwardable-extended, pathutil, rouge, safe_yaml, jekyll after 35 seconds
19 gems installed
youcanpingdeMacBook-Pro:~ issuser$

  五、jekyll创建blog,发现报错了

youcanpingdeMacBook-Pro:~ issuser$ jekyll new Blog
Dependency Error: Yikes! It looks like you don't have bundler or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- bundler' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!
jekyll 3.5.1 | Error: bundler
youcanpingdeMacBook-Pro:~ issuser$ gem install bundler
Fetching: bundler-1.15.3.gem (100%)
Successfully installed bundler-1.15.3
Parsing documentation for bundler-1.15.3
Installing ri documentation for bundler-1.15.3
Done installing documentation for bundler after 5 seconds
1 gem installed
youcanpingdeMacBook-Pro:~ issuser$ jekyll new blog
Conflict: /Users/issuser/blog exists and is not empty.
youcanpingdeMacBook-Pro:~ issuser$ cd Desktop/
youcanpingdeMacBook-Pro:Desktop issuser$ cd GitHub/
youcanpingdeMacBook-Pro:GitHub issuser$ LS
youcanping.github.io
youcanpingdeMacBook-Pro:GitHub issuser$ cd youcanping.github.io/
youcanpingdeMacBook-Pro:youcanping.github.io issuser$ jekyll server


 



一、Github博客搭建之jekyll安装的更多相关文章

  1. 超详细Hexo+Github博客搭建小白教程

    原文链接:超详细Hexo+Github博客搭建小白教程 去年9月的时候开始搭建了第一个自己的独立博客,到现在也稍微像模像样了.很多小伙伴应该也想过搭建一个自己的博客,网上也有一堆详细教程.我在此稍稍总 ...

  2. Pelican+Github博客搭建详细教程

    操作系统:Mac OS / Linux 工具集: 1.Pelican--基于Python的静态网页生成器 2.马克飞象--Evernote出的Markdown文本编辑器 3.GoDaddy--域名供应 ...

  3. hexo&github博客搭建

    闲来无事,偶然看到hexo,便试着玩玩,hexo是一种静态博客工具,使用nodejs流生成静态博客,速度快,主题多,附地址:https://hexo.io/ 下面详细介绍如何使用hexo在github ...

  4. Hexo+Github博客搭建

    一.准备 1.安装git 点击下载:链接:https://pan.baidu.com/s/1eToStns 密码:r93r 安装参考之前随笔:http://www.cnblogs.com/jiangb ...

  5. 【博客搭建】Typecho个人博客搭建,快速安装,超小白(很简单的)

    使用Typecho框架一个月又十二天了,就目前感觉来说,整体还不错,很多方面都支持个性化,二次开发,但是目前MD编辑器有一丢丢问题,不能同步滚动条滚动,就是编辑器区域滚动,预览区域没有动静,需要两边都 ...

  6. Hexo+Github: 博客网站搭建完全教程(看这篇就够了)

    本篇教程首次发布在个人博客:sunhwee.com,想要获得最佳阅读体验,欢迎前往,建议用电脑查看教程文档. # 阅读须知 注意,这篇文章篇幅较长,主要针对新手,每一步很详细,所以可能会显得比较啰嗦, ...

  7. WordPress博客搭建与问题总结

      一.WordPress博客搭建 1.安装Apache web服务器 yum install -y httpd systemctl restart httpd systemctl enable ht ...

  8. 【环境搭建】使用Jekyll搭建Github博客

    前言 昨天花了差不多一天的时间,使用Jekyll搭建起了一套Github博客,感觉不错,也特将搭建过程记录下来,方便有需要的朋友自行搭建. 搭建步骤 本环境是在Linux环境下搭建完成的 安装前建议使 ...

  9. 在github上搭建博客(使用Jekyll)

    简单说,只需要三步,就可以在 Github 搭建起一个博客: 在 Github 上建一个名为 xxx.github.io 的库: 把看中了的 Jekyll 模板 clone 到本地: 把这个模板 pu ...

随机推荐

  1. Logistic Regression and Newton's Method

    Data For this exercise, suppose that a high school has a dataset representing 40 students who were a ...

  2. Activemq去除认证

    0.背景介绍 由于项目安全性的约束,不能在配置文件中暴露一些密码信息.   默认情况下,ActiveMQ在进行接发消息的时候会用户认证.通过ActiveMQ-client初始化ActiveMQConn ...

  3. 通过CURL抓取页面中的图片路径并下载到本地

    1.首页是图片处理页面downpic.php <?phpfunction getImage($url,$filename="") { if($url=="" ...

  4. BOM 请给javascript一个说法-------Day33

    楼市低迷,业主是不是该要个说法.黄金暴跌,谁来给大妈们一个说法.中国足球,敢不敢给大家一个说法. 给个说法,谁给,给谁,这该是哲学的范畴了吧. 可是,在这里.BOM是真真切切的给javascript一 ...

  5. 10小时之内,暴力破解SSH账号的IP

    10小时之内,暴力破解SSH账号的IP,IP 地址数据来源于  ip138.com 182.18.76.246 北京市昌平区 北京亿安天下网络科技有限公司 联通 221.223.200.143 北京市 ...

  6. Android学习笔记进阶九之Matrix对称变换

    网上很多的倒影特效实际上就是一个对称变换,在改变透明度即可. Matrix对称变换包括很多种,有关于Y轴对称,关于X轴对称,关于y= -x对称等等. 1 关于Y轴对称 // 获取资源文件的引用res ...

  7. Error: org.apache.mahout.math.CardinalityException: Required cardinality 10 but got 30问题解决办法

    问题详情 在运行mahout中kmeans算法时,采取的是其默认输入路径/user/hadoop/testdata 和 默认输出路径/user/hadoop/output. [hadoop@djt00 ...

  8. HDU 1548 A strange lift(最短路&&bfs)

    A strange lift Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)To ...

  9. CList 点击表头排序 (2)两种排序方法中其中一种

    上一篇讲解SortItem()方法如何使用,虽然都是抄别人的但是就是想让大家有个大概的了解 CList 点击表头排序 (1)SortItems函数 点击表头排序基本思路都是 1.首先响应HDN_ITE ...

  10. JS 数字格式千分位相互转换

    /** * 将数值四舍五入后格式化. * * @param num 数值(Number或者String) * @param cent 要保留的小数位(Number) * @param isThousa ...