使用github和jekyll打造自己的独立博客及常见问题

使用github和jekyll打造自己的独立博客

利用Github提供的Pages功能,把本地搭建的Jekyll站点部署上去,实现一个自由定制的个人静态博客。具体的操作google教程一大把,这里就不再重复造车,本文主要记录自己在这2天参考的教程,以及在操作过程中遇到的各种疑难杂症,供有需要的朋友少走弯路。
参考文章:
仔细看看上面三篇文章,基本能打造一个自己的独立blog,过程中有疑问请自行google,下面主要记录自己搭建时遇到的几个奇葩问题。

github和jekyll打造个人博客常见问题

gem安装jekyll报错Could not find a valid gem 'jekyll'

报错:ERROR:Could not find a valid gem 'jekyll' (>= 0), here is why:
      Unable to download data from https://rubygems.org/ - no such name (https://api.rubygems.org/specs.4.8.gz)
解决方法:
参考https://gems.ruby-china.org/,将gem源修改成 http://gems.ruby-china.org  修改成功后查看源信息如下图


jekyll新建博客报错找不到系统路径

jekyll新建blog报错Runing bundle install in ...系统找不到指定路径
同时启动server时报错
D:\blog>jekyll serve
C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/resolver.rb:354:in `block in verify_gemfile_dependencies_are_found!': Could not find gem 'minima (~> 2.0) x86-mingw32' in any of the gem sources listed in your Gemfile or available on this machine. (Bundler::GemNotFound)
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/resolver.rb:330:in `each'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/resolver.rb:330:in `verify_gemfile_dependencies_are_found!'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/resolver.rb:199:in `start'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/resolver.rb:183:in `resolve'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/definition.rb:198:in `resolve'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in `specs_for'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in `requested_specs'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in `requested_specs'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in `setup'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/jekyll-3.3.0/lib/jekyll/plugin_manager.rb:36:in `require_from_bundler'
        from C:/RailsInstaller/Ruby2.2.0/lib/ruby/gems/2.2.0/gems/jekyll-3.3.0/exe/jekyll:9:in `<top (required)>'
        from C:/RailsInstaller/Ruby2.2.0/bin/jekyll:23:in `load'
        from C:/RailsInstaller/Ruby2.2.0/bin/jekyll:23:in `<main>'
解决方法:
gem安装bundler(注意翻越万里长城)


jekyll启动server时候报错haven't included the 'jekyll-paginate'

报错:Deprecation: You appear to have pagination turned on, but you haven't included the `jekyll-paginate` gem. Ensure you have `gems: [jekyll-paginate]` in your configuration file.
解决方法:
gem安装jekyll-paginate如下图

注意安装成功后在_config.yml里面添加gems: [jekyll-paginate]配置属性

如果使用duoshuo评论插件,去掉多说评论框右下角的版权声明powered by方法如下

登录多说后台管理,在设置里面找到自定义CSS,贴上下面这句代码:

#ds-thread .ds-powered-by{display:none!important;}






评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值