apt-get install ruby
gem install 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/latest_specs.4.8.gz)
查看当前的gem源:gem sources -l
这绝逼是我大天朝的原因,访问不到呗!
更换Gem sources,改为淘宝的镜像
gem sources –remove https://rubygems.org/
gem sources -a http://ruby.taobao.org/
或者写为一个命令:
gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
查看当前gem源:gem sources -l
再次安装:apt-get install jekyll
报错:
Building native extensions. This could take a while...
ERROR: Error installing jekyll:
ERROR: Failed to build gem native extension.
/usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h
extconf failed, exit code 1
Gem files will remain installed in /var/lib/gems/2.1.0/gems/ffi-1.9.10 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/ffi-1.9.10/gem_make.out
错误说明:构建本地扩展(程序)失败
apt-get install ruby2.1-dev
再次安装jekyll : apt-get install jekyll
安装成功!耶。。。
jekyll new hjrblog
jekyll serve
http://localhost:4000