Install Ruby and other prerequisites:
sudo apt-get install ruby-full build-essential zlib1g-dev Avoid installing RubyGems packages (called gems) as the root user. Instead, set up a gem installation directory for your user account. The following commands will add environment variables to your ~/.bashrc file to configure the gem installation path:
echo ‘# Install Ruby Gems to ~/gems’ » ~/.bashrc echo ‘export GEM_HOME=”$HOME/gems”’ » ~/.bashrc echo ‘export PATH=”$HOME/gems/bin:$PATH”’ » ~/.bashrc source ~/.bashrc Finally, install Jekyll and Bundler:
gem install jekyll bundler That’s it! You’re ready to start using Jekyll.
添加 TUNA 源并移除默认源
gem sources –add https://mirrors.tuna.tsinghua.edu.cn/rubygems/ –remove https://rubygems.org/
列出已有源
gem sources -l
应该只有 TUNA 一个
bundler
使用以下命令替换 bundler 默认源
bundle config mirror.https://rubygems.org https://mirrors.tuna.tsinghua.edu.cn/rubygems 官方文档:https://bundler.io/v2.2/man/bundle-config.1.html#MIRRORS-OF-GEM-SOURCES