Skip to content

Upgrade covering Rails 5.0 to Rails 8.1 #212

Open
ByteDecoder wants to merge 62 commits intojmazzi:masterfrom
ByteDecoder:working_space
Open

Upgrade covering Rails 5.0 to Rails 8.1 #212
ByteDecoder wants to merge 62 commits intojmazzi:masterfrom
ByteDecoder:working_space

Conversation

@ByteDecoder
Copy link

@ByteDecoder ByteDecoder commented Nov 25, 2025

Since this Gem falls behind many Ruby and Rails versions, it is blocking a lot of projects, so this PR covers from Rails 5 to Rails 8.1, Ruby 2.7 to Ruby 3.4.

  • All tests are passing according to the matrix
  • Added a devcontiener to have a unified development environment

This pull request sets up a comprehensive VS Code Dev Container environment for CryptKeeper development, enabling seamless local development and testing with pre-configured Ruby, PostgreSQL, MySQL, and SQLite services. It includes all necessary configuration files, scripts, and documentation to streamline setup, database management, and troubleshooting, especially for Mac M1 users.

Dev Container Environment Setup

  • Added .devcontainer/Dockerfile to build a custom Ruby 3.4 container with all required system dependencies, user setup, and health checks for CryptKeeper development.
  • Introduced .devcontainer/docker-compose.yml to orchestrate the Ruby app, PostgreSQL, and MySQL containers with persistent volumes, health checks, and platform specification for Mac M1 compatibility.
  • Provided .devcontainer/devcontainer.json to define VS Code Dev Container settings, including extensions, environment variables, port forwarding, and post-creation/startup commands.

Database Configuration and Initialization

  • Added .devcontainer/database.yml as a sample database configuration for all supported adapters, and .devcontainer/init-postgres.sql to initialize the required pgcrypto extension in PostgreSQL. [1] [2]
  • Included .devcontainer/.env.template to set default environment variables for encryption keys and database connection details.

Developer Documentation and Tooling

  • Created .devcontainer/README.md with detailed instructions for setup, database management, troubleshooting (especially for Mac M1 issues), and workflow tips.
  • Added .devcontainer/QUICK_REFERENCE.sh as a handy script listing common commands for database access, testing, container management, and troubleshooting.

Mac M1 Troubleshooting Scripts

  • Added .devcontainer/fix-postgres-mac.sh to automate fixing PostgreSQL pgcrypto extension issues on Mac M1, and .devcontainer/fix-ssh-mac.sh to resolve SSH configuration incompatibilities between macOS and Linux containers. [1] [2]

ByteDecoder and others added 27 commits November 24, 2025 15:55
…n Ruby 3.1+. This fixes the uninitialized constant error that occurs with ActiveSupport 6.x on newer Ruby versions.
…e Rails 6.x for Ruby 2.7, 3.0, 3.1, 3.2, 3.4 requires to be loaded manually, then changed after Rails 7+
- Add fix-ssh-mac.sh for immediate SSH config filtering
- Add setup-ssh-container.sh to auto-configure SSH on container start
- Update docker-compose.yml to mount SSH separately (.ssh-host)
- Update devcontainer.json to run SSH setup on container creation
- Add comprehensive documentation in MAC_M1_SSH_FIX.md
- Update README with Mac M1 SSH troubleshooting section
- Update QUICK_REFERENCE with SSH fix commands

The issue was macOS-specific UseKeychain option in SSH config
which is not supported in Linux containers. The fix filters this
option out and sets GIT_SSH_COMMAND to use the filtered config.

Works on both Mac M1 and Windows WSL2 without breaking existing setups.
The psych gem (YAML parser) requires libyaml development headers
to build native extensions. Without this package, ruby-lsp fails
to install on Mac M1 with 'yaml.h not found' error.

This fix ensures ruby-lsp can install successfully on both Mac M1
and Windows WSL2.
@ByteDecoder ByteDecoder reopened this Nov 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant