利用hexo搭建github个人博客遇到的坑及解决

入门

今天下午闲来无事就试试利用hexo来搭建github个人博客,至于hexo是什么,大家可以自行度娘。鉴于我二个月前在windows平台用npm install hexo,然后hexo init失败,找到很多原因,才发现原来是我大天朝的网络原因,之后就没怎么去尝试了。

这两个月来我学习了linux的基础课程,所以我现在尝试用unbuntu搭建我的github上的个人博客。

基本的入门我也是找的文章资料,推荐给大家:

Hexo搭建Github静态博客

遇到的坑

1、在执行 hexo deploy 后,出现 error deployer not found:github 的错误

2、hexo deploy 遇到Permanently added the RSA host key for IP address ‘192.30.252.128’ to the list of known hosts问题

3、git config配置文件

4、github提示Permission denied (publickey)

解决办法(序号对应上面的坑序号)

1、对于这个问题的解决方案为:

先修改_config.yml中type : git

npm install hexo-deployer-git –save

重新 deploy 即可

2、刚开始使用github的时候不是很了解,新手一般的都会遇到这个问题Permanently added the RSA host key for IP address ‘192.30.252.128’ to the list of known hosts。其实这只是一个警告无伤大雅,继续用就是了,但是看着就是不爽,然后就想办法把他KO,一招致命。

解决办法:

vim /etc/hosts

添加一行:192.30.252.128  github.com

3、在命令行输入:

$ git config –global user.name “John Doe”。

$ git config –global user.email [email protected]

4、极大多数情况是由于github账号没有设置ssh公钥信息所致。 前往 GitHub 网站的”account settings”

依次点击”Setting -> SSH Keys”->”Add SSH key”

Title处填写“id_rsa.pub”或其他任意信息。 key处原样拷贝下面命令的打印~/.ssh/id_rsa.pub文件的内容:

cat~/.ssh/id_rsa.pub

如没有则按下述方法生成:

在shell命令行输入:

ssh-keygen -t rsa

一路回车……

最后,输入“ssh -T [email protected]”确认OK即可。

结束

附上自己成功后的github:cllgeek.github.io

本文所涉及的资料原文:

1、http://www.v2ex.com/t/175940

2、http://www.cnblogs.com/xiangyangzhu/p/5316041.html

3、http://blog.csdn.net/joe_007/article/details/7276195

4、http://www.zhihu.com/question/21402411

你可能感兴趣的:(利用hexo搭建github个人博客遇到的坑及解决)