为了搭建github-pages博客,而github-pages后端依赖于ruby,且对版本有严格要求,自己尝试了各种姿势升级ruby2.3无果,最终在查阅了各种资料之后找到一个可行方案。

icebug@localhost:~$ sudo apt-get -y install software-properties-common 
icebug@localhost:~$ sudo apt-add-repository ppa:brightbox/ruby-ng 
icebug@localhost:~$ sudo apt-get update
icebug@localhost:~$ sudo apt-get -y install ruby2.3

同时不要忘记了安装ruby2.3的开发库,不然还是会遇到各种坑.....

icebug@localhost:~$ sudo apt-get install ruby2.3-dev

升级ruby到2.3之后执行

bundler update

还是出现以下错误
ubuntu12.04安装ruby2.3

奇怪的是竟然不影响github-pages的安装

icebug@localhost:~$ sudo gem install github-pages

运行jekyll server

icebug@localhost:~$ bundle exec jekyll serve

设定jekyll server监听IP,这个跟Flask和Django差不多,直接在后面加上--host参数就OK

icebug@localhost:~$ bundle exec jekyll server --host=0.0.0.0

默认会监听4000端口

相关文章:

  • 2022-01-07
  • 2021-12-18
  • 2021-10-23
  • 2021-06-07
  • 2021-06-10
  • 2021-11-03
猜你喜欢
  • 2022-12-23
  • 2021-09-27
  • 2022-02-16
  • 2021-06-22
  • 2021-12-23
  • 2021-06-07
  • 2021-09-06
相关资源
相似解决方案