This guide provides commands to set up a conda environment for running this Jekyll site locally.
# Create conda environment with Ruby (using conda-forge channel)
conda create -n jekyll-env -c conda-forge ruby=3.1 nodejs -y
Important: After activating the conda environment, you need to ensure the conda Ruby is used instead of the system Ruby.
conda activate jekyll-env
export PATH="/opt/anaconda3/envs/jekyll-env/bin:$PATH"
Note: Replace /opt/anaconda3 with your conda installation path if different. You can find it with conda info --base.
Make sure you’re using the conda Ruby (should be 3.3.x or 3.1.x):
which ruby
ruby --version
You should see something like /opt/anaconda3/envs/jekyll-env/bin/ruby and ruby 3.3.x or ruby 3.1.x.
gem update --system
gem install bundler
cd /Users/shiqihe/Desktop/3_Project/tctower.github.io
If the Gemfile doesn’t exist or is incorrect, create one with the following content:
cat > Gemfile << 'EOF'
source "https://rubygems.org"
gem "github-pages", group: :jekyll_plugins
gem "jekyll-include-cache", group: :jekyll_plugins
group :jekyll_plugins do
gem "jekyll-paginate"
gem "jekyll-sitemap"
gem "jekyll-gist"
gem "jekyll-feed"
end
EOF
bundle install
npm install
bundle exec jekyll serve
The site will be available at http://localhost:4000
bundle exec jekyll serve --livereload
conda activate jekyll-env
export PATH="/opt/anaconda3/envs/jekyll-env/bin:$PATH"
cd /Users/shiqihe/Desktop/3_Project/tctower.github.io
Note: The export PATH command is crucial to ensure you’re using the conda Ruby, not the system Ruby.
bundle exec jekyll serve
bundle exec jekyll build
bundle update
conda deactivate
# Use --user-install flag
gem install bundler --user-install
This usually means you’re using the system Ruby instead of conda Ruby. Fix it with:
# Make sure you're in the conda environment
conda activate jekyll-env
# Fix PATH to use conda Ruby
export PATH="/opt/anaconda3/envs/jekyll-env/bin:$PATH"
# Verify you're using the right Ruby
which ruby
ruby --version
# Update RubyGems
gem update --system
# Then try bundle install again
bundle install
# Check Jekyll version
bundle exec jekyll --version
# Try with verbose output
bundle exec jekyll serve --verbose
conda activate jekyll-env
export PATH="/opt/anaconda3/envs/jekyll-env/bin:$PATH"
cd /Users/shiqihe/Desktop/3_Project/tctower.github.io
bundle exec jekyll serve
Ctrl+C to stop the server_site/ directory (this is ignored by git)bundle exec prefix when running Jekyll commands to ensure you’re using the correct gem versions