-
Notifications
You must be signed in to change notification settings - Fork 0
/
Jekyll_for_Github_IO_Website_Mac.txt
59 lines (52 loc) · 2.5 KB
/
Jekyll_for_Github_IO_Website_Mac.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# First Update in 01/25/2021
# Personally, I prefer to using Jekyll and github io for hosting my personal
# website to record my life and research
# Mac OS: Big Sur v11.1
# MBP M1 2020
# Big Sur comes with ruby 2.6.3 and gem 3.0.3
# But I don't wish to mess them up
# I will set up a separate ruby environment
# Check your current ruby version and gem version by
ruby -v
gem -v
# Install Command Line tools
xcode-select --install
# Install Homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Add Homebrew to your PATH, replace [USER_NAME] with your username
# For me I use, echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/hailinren/.zprofile
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/[USER_NAME]/.zprofile
# Get a new terminal (close and open a new one) to make changes take effect
# Install ruby via Homebrew
brew install ruby
# Add Homebrew's ruby to PATH
echo 'export PATH="/usr/homebrew/opt/ruby/bin:$PATH"' >> ~/.zshrc
# Get a new terminal (close and open a new one) to make changes take effect
# Install rbenv (For details https://github.com/rbenv/rbenv)
# In a nutshell, rbenv is something like python virtual environment or anaconda
# environment.
brew install rbenv
# Setup rbenv in shell, put following into the .zshrc. So you dont need to run
# rbenv init everytime you open a new terminal
eval "$(rbenv init -)"
# Verify that rbenv is properly set up using this rbenv-doctor script
curl -fsSL https://github.com/rbenv/rbenv-installer/raw/master/bin/rbenv-doctor | bash
# Setup ruby configuration for installing elder version ruby
# Refer to https://github.com/rbenv/ruby-build/issues/1360
# Put following into the .zshrc
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
# Get a new terminal (close and open a new one) to make changes take effect
# Install a rbenv instantiation
rbenv install 2.5.5
# Install the bundler and jekyll gems
gem install --user-install bundler jekyll
# Replacing the X.X with the first two digits of your Ruby version
# For me I use, echo 'export PATH="$HOME/.gem/ruby/2.5.0/bin:$PATH"' >> ~/.zshrc
echo 'export PATH="$HOME/.gem/ruby/X.X.0/bin:$PATH"' >> ~/.zshrc
# Get a new terminal (close and open a new one) to make changes take effect
# Now you have rbenv 2.5.5 with jekyll installed
# Your .zshrc should look like
export PATH="/opt/homebrew/opt/ruby/bin:$PATH"
export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.1)"
eval "$(rbenv init -)"
export PATH="$HOME/.gem/ruby/2.5.0/bin:$PATH"