Skip to main content

Ruby

By Amr

Ruby versioning and Bundler tips for Zer0-Mistakes.

Estimated reading time: 1 minutes

Ruby & Bundler

Jekyll is built with Ruby. Understanding the basics helps with troubleshooting and customization.

Quick Reference

Check Versions

# Ruby version
ruby --version

# Bundler version
bundle --version

# Jekyll version
bundle exec jekyll --version

Common Commands

# Install dependencies from Gemfile
bundle install

# Update all gems
bundle update

# Update specific gem
bundle update jekyll

# Run Jekyll through Bundler
bundle exec jekyll serve

Key Files

File Purpose
Gemfile Lists Ruby gem dependencies
Gemfile.lock Locks exact versions
jekyll-theme-zer0.gemspec Theme gem specification

With Docker

When using Docker, Ruby commands run inside the container:

# Check Ruby version in container
docker-compose exec jekyll ruby --version

# Update gems in container
docker-compose exec jekyll bundle update

Troubleshooting

Gem Installation Errors

# Clear bundle cache
bundle clean --force

# Reinstall everything
rm -rf vendor/bundle
bundle install

Version Conflicts

# Check for outdated gems
bundle outdated

# Update Gemfile.lock
bundle update

Learn More