A complete solution for building Ruby 3.0.7 RPM packages and hosting them as a YUM/DNF repository on GitHub. Perfect for Enterprise Linux environments (Amazon Linux, Rocky Linux, RHEL, CentOS, etc.).
This project provides:
- Docker-based Ruby RPM Builder: Builds Ruby 3.0.7 with compat-openssl11 support
- Automated RPM Repository: Creates a complete YUM/DNF repository with metadata
- GitHub-hosted Package Distribution: Serves RPM packages directly from GitHub
- Easy Server Installation: One-line installation script for your servers
π¦ Ruby Build Process
βββ π³ Docker Container
β βββ Builds Ruby 3.0.7 + compat-openssl11 RPMs
β βββ Creates repository metadata (repodata/)
β βββ Generates client setup files
βββ π― GitHub Actions
β βββ Automates the build process
β βββ Uploads complete repository as artifact
βββ π Repository Structure
βββ ruby3-0-7/
βββ rpm-repo/x86_64/ # RPM packages + metadata
βββ client-setup/ # Installation scripts
# Fork this repository to your GitHub account
# Clone your fork
git clone https://github.com/YOUR-USERNAME/ruby-build.git
cd ruby-build# Go to GitHub Actions tab in your repository
# Run "Build Ruby RPM (Simple)" workflow
# Click "Run workflow" button (x86_64 only)# After build completes:
# 1. Go to Actions β Latest Run β Artifacts
# 2. Download "ruby3-0-7-complete-x86_64"
# 3. Extract the zip file
# 4. You'll get a ruby3-0-7/ folder
# Update repository URLs in the files:
# Edit ruby3-0-7/client-setup/ruby-build.repo
# Edit ruby3-0-7/client-setup/install.sh
# Replace USERNAME/REPOSITORY with your GitHub details
# Upload to your repository
cp -r ruby3-0-7 /path/to/your/repo/
cd /path/to/your/repo/
git add ruby3-0-7/
git commit -m "π Add Ruby 3.0.7 RPM repository"
git push# Replace YOUR-USERNAME/YOUR-REPO with actual repository details
curl -fsSL https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/main/ruby3-0-7/client-setup/install.sh | sudo bash# Install Ruby and dependencies
sudo dnf install ruby compat-openssl11
# Verify installation
ruby --version
dnf info ruby # Should show ruby-build-3-0-7 as source# Search for available Ruby packages
dnf search ruby --repo=ruby-build-3-0-7
# List all packages from ruby-build repository
dnf list available --repo=ruby-build-3-0-7
# Update Ruby packages
sudo dnf update --repo=ruby-build-3-0-7- GitHub account
- Basic familiarity with GitHub Actions
- Text editor for updating configuration files
-
Access GitHub Actions
- Go to your forked repository on GitHub
- Click "Actions" tab
- Select "Build Ruby RPM (Simple)" workflow
-
Configure Build
- Click "Run workflow"
- Select branch:
main - Click "Run workflow" button (builds x86_64 automatically)
-
Monitor Build Progress
- Build takes approximately 15-20 minutes
- Watch the progress in the Actions tab
- Green checkmark = successful build
- Red X = build failed (check logs)
-
Download Artifacts
- After successful build, scroll to "Artifacts" section
- Download
ruby3-0-7-complete-x86_64.zip - Extract the zip file to get
ruby3-0-7/folder
ruby3-0-7/
βββ rpm-repo/
β βββ x86_64/
β βββ repodata/ # Repository metadata
β β βββ repomd.xml # Main metadata file
β β βββ primary.xml.gz # Package information
β β βββ filelists.xml.gz # File listings
β β βββ other.xml.gz # Additional metadata
β βββ ruby-3.0.7-*.rpm # Ruby interpreter
β βββ ruby-libs-*.rpm # Ruby libraries
β βββ ruby-devel-*.rpm # Development files
β βββ compat-openssl11-*.rpm # OpenSSL 1.1 compatibility
βββ client-setup/
βββ ruby-build.repo # YUM/DNF repository config
βββ install.sh # Automated installation script
# Open ruby3-0-7/client-setup/ruby-build.repo
# Update this line:
baseurl=https://raw.githubusercontent.com/USERNAME/REPOSITORY/main/ruby3-0-7/rpm-repo/x86_64/
# Replace USERNAME with your GitHub username
# Replace REPOSITORY with your repository name
# Example:
baseurl=https://raw.githubusercontent.com/johndoe/ruby-build/main/ruby3-0-7/rpm-repo/x86_64/# Open ruby3-0-7/client-setup/install.sh
# Update this line:
REPO_URL="https://raw.githubusercontent.com/USERNAME/REPOSITORY/main"
# Example:
REPO_URL="https://raw.githubusercontent.com/johndoe/ruby-build/main"# Method 1: Using the install script (recommended)
curl -fsSL https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/main/ruby3-0-7/client-setup/install.sh | sudo bash
# Method 2: Manual configuration
sudo curl -o /etc/yum.repos.d/ruby-build-3-0-7.repo \
https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/main/ruby3-0-7/client-setup/ruby-build.repo
sudo dnf clean all
sudo dnf makecacheThe repository is configured with priority=9, which means:
- Lower number = Higher priority
- Amazon Linux default repos typically have priority 10
- Your Ruby packages will be preferred over Amazon Linux Ruby packages
- System-critical repos (priority 1-50) still take precedence
# Check if repository is installed
dnf repolist | grep ruby-build
# Verify Ruby will come from your repository
dnf list ruby --showduplicates
# Check package information
dnf info ruby
# Test Ruby installation
ruby --version
which ruby- Ruby 3.0.7: Main interpreter with compat-openssl11 support
- Ruby Libraries: Runtime libraries and standard library
- Ruby Development: Headers and development tools
- compat-openssl11: OpenSSL 1.1.1 compatibility layer
- Repository Metadata: Complete YUM/DNF repository structure
- Container Setup: Amazon Linux base with development tools
- OpenSSL Build: Builds compat-openssl11 packages from source
- Ruby Configuration: Modifies Ruby spec to use compat-openssl11
- RPM Building: Creates all Ruby-related packages
- Repository Creation: Generates metadata with
createrepo_c - Testing: Verifies package installation and Ruby functionality
- No GPG Signing: Packages are not GPG signed (gpgcheck=0)
- Public Repository: All packages are publicly accessible
- Source Verification: Built from official Rocky Linux SRPMs
- Container Isolation: Build process runs in isolated container
- Architecture: x86_64 only (Intel/AMD 64-bit)
- OS Compatibility: Enterprise Linux 9 (Amazon Linux 2023, Rocky Linux 9, RHEL 9, CentOS 9, AlmaLinux 9)
- Ruby Version: 3.0.7 (with potential for version updates)
- Note: aarch64 (ARM64) support removed for simplicity
# Check Docker logs
docker logs ruby-builder
# Common issues:
# - Network connectivity problems
# - Insufficient disk space
# - Missing dependencies# Artifacts are only available for:
# - 30 days after build
# - Successful builds only
# - Repository collaborators
# Re-run the workflow if artifact expired# Verify repository URL is accessible
curl -I https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/main/ruby3-0-7/client-setup/ruby-build.repo
# Should return "200 OK"# Remove existing Ruby packages
sudo dnf remove ruby* rubygems* --skip-broken
# Clean DNF cache
sudo dnf clean all
# Reinstall from ruby-build repository
sudo dnf install ruby --repo=ruby-build-3-0-7# Ensure you have sudo privileges
sudo -v
# Check repository file permissions
ls -la /etc/yum.repos.d/ruby-build-3-0-7.repo- Check GitHub Actions logs for detailed build information
- Look for error messages in Docker build steps
- Verify all dependencies are correctly installed
- Verify file permissions and accessibility
- Check network connectivity from server
- Ensure repository URLs are correctly configured
- Test with
ruby --versionandruby -e "puts 'Hello'" - Check library loading with
ruby -e "require 'openssl'; puts OpenSSL::VERSION" - Verify gem installation with
gem --version
# Create additional version directories
ruby3-1-0/
ruby3-2-0/
# Each with their own rpm-repo and client-setup# Modify Dockerfile to:
# - Change Ruby version
# - Add additional packages
# - Modify build flags
# - Include custom patches# Periodic tasks:
# - Update Ruby versions
# - Clean old packages
# - Monitor repository size
# - Update security patchesThis repository includes a working example of Ruby 3.0.7 running Rails 7.0 on Amazon Linux. The setup demonstrates compatibility and provides a foundation for Rails applications.
# Build the Rails test container
podman build -f Dockerfile.optimized -t rails-ruby-test .
# Run the Rails application
podman run -d -p 3000:3000 --name rails-app rails-ruby-test
# Test the application
curl http://localhost:3000/todos
# View logs
podman logs rails-app
# Stop and cleanup
podman stop rails-app && podman rm rails-appThe test application includes:
- Rails 7.0.8.7 running on Ruby 3.0.7
- SQLite3 database with todo scaffold
- Compatibility fixes for Logger constant issues
- Native gem compilation (nokogiri, psych, etc.)
- OpenSSL compatibility using compat-openssl11
- Responsive web interface with basic styling
# View todo list
curl http://localhost:3000/todos
# Create new todo (GET form)
curl http://localhost:3000/todos/new
# Access individual todos
curl http://localhost:3000/todos/1
curl http://localhost:3000/todos/2
curl http://localhost:3000/todos/3The application comes with test todos to verify functionality:
- "Test Ruby 3.0.7 + Rails 7.0" - Compatibility verification
- "Check OpenSSL compatibility" - compat-openssl11 validation
- "Test gem compilation" - Native extension verification
-
Logger Constant Issue:
# Patches ActiveSupport logger_thread_safe_level.rb RUN find /usr/local/share/gems/gems -name "logger_thread_safe_level.rb" -exec sed -i '1i require "logger"' {} \;
-
Psych Gem Compilation:
# Adds required YAML development headers RUN yum install -y libyaml-devel
-
System Dependencies:
# Complete development environment RUN yum install -y gcc gcc-c++ make sqlite-devel libyaml-devel
Use the optimized Dockerfile as a base for your Rails applications:
FROM amazonlinux:latest
# Copy the Ruby installation steps from Dockerfile.optimized
# Add Ruby 3.0.7 repository
RUN curl -fsSL "https://raw.githubusercontent.com/YOUR-USERNAME/YOUR-REPO/main/ruby3-0-7/client-setup/ruby-build.repo" \
-o "/etc/yum.repos.d/ruby-build-3-0-7.repo"
# Install Ruby and system dependencies
RUN yum clean all && yum makecache && \
yum install -y ruby ruby-devel compat-openssl11 compat-openssl11-devel \
gcc gcc-c++ make sqlite-devel libyaml-devel nodejs npm
# Install Rails and apply compatibility fixes
RUN gem install rails -v "~> 7.0.0" --no-document && \
find /usr/local/share/gems/gems -name "logger_thread_safe_level.rb" -exec sed -i '1i require "logger"' {} \;
# Add your Rails application
COPY . /app
WORKDIR /app
RUN bundle install
# Start your Rails app
CMD ["rails", "server", "-b", "0.0.0.0"]Container build times:
- From source compilation: ~20+ minutes
- Using RPM repository: ~5 minutes
- Build cache utilization: ~2 minutes for rebuilds
Runtime verification:
- Rails server starts in ~3-5 seconds
- Native gems compile successfully
- Full CRUD operations functional
- OpenSSL/TLS connections working
Common Rails + Ruby 3.0.7 issues:
-
Logger constant errors:
# Already fixed in Dockerfile.optimized # Manual fix: Add require "logger" to problematic files
-
Psych compilation failures:
# Ensure libyaml-devel is installed yum install -y libyaml-devel -
Bundle install as root warnings:
# Non-critical warning - application still functions # For production, use non-root user
-
Gem compilation issues:
# Ensure all development packages are installed yum install -y gcc gcc-c++ make openssl-devel libffi-devel
- RPM Packaging Guide
- DNF Repository Management
- Ruby Build Configuration
- GitHub Actions Documentation
- Rails 7.0 Documentation
- Issues: Report problems in the GitHub Issues section
- Discussions: Use GitHub Discussions for questions
- Contributions: Pull requests welcome for improvements
This project is provided as-is for building Ruby RPM packages from official sources. All built packages maintain their original licensing terms:
- Ruby: Licensed under Ruby License / BSD 2-Clause License
- OpenSSL: Licensed under Apache License 2.0
- Rocky Linux packages: Follow respective upstream licenses
- v1.0: Initial Ruby 3.0.7 build with compat-openssl11
- v1.1: Added automated repository generation
- v1.2: GitHub-hosted repository with client setup
- Current: Complete automated workflow with manual deployment
Need Help? Open an issue in this repository or check the troubleshooting section above.