From 972648b66db230a4b3dc6488b8a6fc31eb56b678 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Jos=C3=A9=20Mata?= Date: Fri, 14 Nov 2025 09:54:22 +0100 Subject: [PATCH] Keep Codex running with new 3.4.7 Ruby MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added Ruby version compatibility check and handling in codex-env script. Signed-off-by: Juan José Mata --- bin/codex-env | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/codex-env b/bin/codex-env index 8c60a7a19..f03bd72a9 100755 --- a/bin/codex-env +++ b/bin/codex-env @@ -37,6 +37,20 @@ runuser -l postgres -c "createuser -s $(whoami)" 2>/dev/null || echo "User may a echo "Starting Redis server..." service redis-server start +# Check Ruby version compatibility +RUBY_VERSION=$(cat .ruby-version | tr -d '[:space:]') +CURRENT_RUBY=$(ruby -v | awk '{print $2}' | cut -d'p' -f1) +echo "Ruby version check: $CURRENT_RUBY (required: $RUBY_VERSION)" + +# Removing Ruby version requirement from Gemfile +if [ "$CURRENT_RUBY" != "$RUBY_VERSION" ]; then + echo "Ruby version mismatch — commenting ruby version requirement in Gemfile..." + # Only comment if the line isn't already commented + sed -i 's/^ruby file: "\.ruby-version"$/#&/' Gemfile + # Ignore Gemfile changes for this session + git update-index --assume-unchanged Gemfile Gemfile.lock +fi + echo "Environment setup completed successfully!" echo "PostgreSQL and Redis are now running." echo "You can now run 'bin/setup' to prepare your Rails application and database."