搞了一天终于稍微成功在github上搭了个博客...

Update:10.21

更新博客想rake deploy时出现
updates were rejected because the tip of your current branch is behind its remote counterpart

这贴:
http://allenyee.me/blog/2013/08/21/what-i-learned-from-hosting-octopress-on-github/
I resolved this by going to _deploy folder:
    cd octopress/_deploy
Since the master branch is inside deploy, I did a:
    git pull origin master
I then resolved conflicts, and pushed the commit. Now, I return to octopress folder:
    cd ..
Try:
    rake deploy


Old:10.19

参考这帖子http://shanewfx.github.io/blog/2012/02/16/bulid-blog-by-octopress/

作为一个git新手,完全不懂ruby的人来说,搭这个blog真的太desperate了...

一开始用乌龟git绑定git账号,但是出错failed to create locked file,应该是我以前绑定过另外一个账号,那个账号已经不能用了(学校提供的),然后残留历史记录,于是怎么搞也搞不定...然后怒卸tortoisegit...

因为之前在已经注册了github账号,装了个github for windows,所以ssh key 已经有了。

之后安装Ruby

ruby dk.rb init
ruby dk.rb install

这两步很成功,但是接下来
gem install rdiscount --platform=ruby

这步就卡住了...提示某个目录不存在,而那个目录是我以前的git仓库,不过路径更改了。用乌龟git设置了好久,加上google,也搞不明白是什么回事...于是直接将那目录恢复,然后就成功了...

安装octopress一路顺利。之后,

rake generate
rake preview

打开ihttp://localhost:4000/,页面显示空白,第一直觉是我又遇到奇葩问题了...google之,最后发现是该url是显示octopress\public里的网页,而我这里面没有任何东西,随便放了点东西进去,然后就有显示了。

rake deploy

这步要搞死人的节奏...错误提示please make sure you have the correct access rights and the repository exists

google后得知可能公匙有问题?于是将当前公匙删掉,按照上面提到那帖子重新生成公匙。我保证完全按照“正确”的方法做的,而且好多网站(国内)提到的方法都是一样,不过生成的公匙显示never used...令人不得不怀疑这又有问题...

在stackoverflow上看到http://stackoverflow.com/questions/4269922/permission-denied-publickey-when-deploying-heroku-code-fatal-the-remote-end

octopress keys:add ~/.ssh/id_rsa.pub
貌似执行以上命令后,重新生成了一个“能被使用”的ssh...而这key的备注是git for windows...不明白...deploy失败应该不关ssh的问题。

google后,使用各种command,刨根问底后,提示origin does not appear to be a git repository

然后在这里找到方法http://blog.csdn.net/dengjianqiang2011/article/details/9260435

git remote add origin URL

这个命令挺重要的,不过那些教程貌似都没提到...不知道怎么回事...

最后不知道怎么的就deploy成功,能上传东西了,好奇怪...

然后就是博客的名字一定要和你github用户名一样!这点教程也没提到= =否则会404...

git add .

执行这步什么反应也没有...将.gitignore这个文件删除后就可以了...http://stackoverflow.com/questions/10859632/git-add-doesnt-work

以为万事大吉啦,github官方发了份email来:

The page build failed with the following error:
The tag `include_array` in `index.html` is not a recognized Liquid tag. 
For more information, see https://help.github.com/articles/page-build-failed-unknown-tag-error.
不知道怎么回事...最后将提示的代码删掉后重新部署,最后成!功!了!
搞了整整一天,真不容易啊...好糟糕的感觉...有些问题没有搞清楚,然后越积越多,最后感觉没什么东西学会...只是单纯地乱试,没有分析问题的所在...

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值