使用Jekyll在Github上搭建博客,并上传代码到gith
最近在玩github,突然发现很多说明网站或者一些介绍页面全部在一个域名是*****.github.io上。
It looks like you don't have jekyll-paginate or one of its dependencies installed
好奇!!!真的好奇!!!怎么弄的?我也要一个~~~
Dependency Error: Yikes! It looks like you don’t have jekyll-paginate 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 – jekyll-paginate’ If you run into trouble, you can find helpful resources at Getting Help
jekyll 3.1.2 | Error: jekyll-paginate
于是去网站上查询了一下,找到了官方网站。
解决办法:安装jekyll时候直接运行gem install jekyll-paginate即可解决
只可以写html静态页面。在最下方找到了一个github推荐的Jekyll。
plugins
jekyll原网站是英文的,这里有个翻译的网站:。不过貌似有些日子没更新了,还是推荐看回官网。
感谢作者分享 第6条写反了 "配置文件_config.yml中,使用了 plugins 的配置项,用 gems 替换 plugins 即可。"应该是用plugins替换掉gems.
Configuration file: /_config.yml
Source: .
Destination: ./_site
Generating...
done.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for '.'
Configuration file: /_config.yml
jekyll 2.4.0 | Error: Permission denied - bind(2) for 127.0.0.1:4000
于是,通过jekyll,开启了github的网站搭建之路。
作者:AlphaJian
链接:http://www.jianshu.com/p/12e7e1f8007e
來源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
打开terminal,任意路径执行: gem install jekyll
抛出异常:
ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.0.0 directory.
解决方法:
sudo gem install jekyll
jekyll serve 启动失败
jekyll serve
Incremental build: disabled. Enable with –incremental
Generating…
done in 0.558 seconds.
Please add the following to your Gemfile to avoid polling for changes:
gem ‘wdm’, ‘>= 0.1.0’ if Gem.win_platform?
Auto-regeneration: enabled for ‘E:/myBlog/xxue’
Configuration file: E:/myBlog/xxue/_config.yml
jekyll 3.3.1 | Error: Permission denied - bind(2) for 127.0.0.1:4000
2. 在github上创建项目username.github.io
解决办法:修改_config.yml文件
后面添加一行:port: 4001(数字前面需添加空格)
3. 拉取项目到本地
启动blog的步骤:
4. 在terminal中,任意路径执行: jekyll new username.github.io
Administrator@ÉßáÌ MINGW64
/d/643435675.github.io
(master)
$ gem install jekyll
Successfully installed jekyll-3.6.2
Parsing documentation for jekyll-3.6.2
Done installing documentation for jekyll after 4 seconds
1 gem installed
5. 将生成的文件复制到刚刚拉取的github项目目录下。
Administrator@ÉßáÌ MINGW64
/d/643435675.github.io
(master)
$ jekyll s
Configuration file: D:/643435675.github.io/_config.yml
Deprecation: The 'gems' configuration option has been renamed to
'plugins'. Please update your config file accordingly.
Dependency Error: Yikes! It looks like you don't have jekyll-paginate 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 -- jekyll-paginate' If you run into
trouble, you can find helpful resources at
https://jekyllrb.com/help/!
jekyll 3.6.2 | Error: jekyll-paginate
6. 同步代码,上传~ 访问username.github.io,即可看到下图,博客搭建完成。
Administrator@ÉßáÌ MINGW64
/d/643435675.github.io
(master)
$ jekyll s
Configuration file: D:/643435675.github.io/_config.yml
Dependency Error: Yikes! It looks like you don't have jekyll-paginate 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 -- jekyll-paginate' If you run into
trouble, you can find helpful resources at
https://jekyllrb.com/help/!
jekyll 3.6.2 | Error: jekyll-paginate
Administrator@ÉßáÌ MINGW64
/d/643435675.github.io
(master)
$ jekyll s
Configuration file: D:/643435675.github.io/_config.yml
Source: D:/643435675.github.io
Destination: D:/643435675.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 6.995 seconds.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'D:/643435675.github.io'
jekyll 3.6.2 | Error: Permission denied - bind(2) for 127.0.0.1:4000
7. 本地运行,切换到项目目录下,执行:jekyll serve
Administrator@ÉßáÌ MINGW64
/d/643435675.github.io
(master)
$ jekyll s
Configuration file: D:/643435675.github.io/_config.yml
Source: D:/643435675.github.io
Destination: D:/643435675.github.io/_site
Incremental build: disabled. Enable with --incremental
Generating...
done in 5.798 seconds.
Please add the following to your Gemfile to avoid polling for changes:
gem 'wdm', '>= 0.1.0' if Gem.win_platform?
Auto-regeneration: enabled for 'D:/643435675.github.io'
jekyll 3.6.2 | Error: Permission denied - bind(2) for 127.0.0.1:4000
8. 在浏览器中执行:
Administrator@ÉßáÌ MINGW64
/d/643435675.github.io
(master)
$ jekyll -v
jekyll 3.6.2