You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(docker): prevent bundler from loading dev/test gems in production builds
Containers were failing to start because Bundler was attempting to resolve
and load development/test gems even though they weren't installed (due to
`bundle install --without development test`). This occurred because Bundler
parses the entire Gemfile and tries to resolve all gem groups, regardless
of the --without flag.
Changes:
- Wrap dev/test gem groups in conditional `unless ENV['SKIP_DEV_GEMS']`
to completely exclude them from Bundler's view during production builds
- Set `ENV SKIP_DEV_GEMS=1` in all Dockerfiles before bundle install
- Add explicit `gem "anycable", "~> 1.5"` to fix missing anycable RPC command
- Update deprecated platform syntax from `:mingw, :x64_mingw` to `:windows`
- Add `.bundle/` to .dockerignore to prevent local bundler config from
overwriting Docker build config
- Make RAILS_ENV configurable via .env with production as default
(`RAILS_ENV: "${RAILS_ENV:-production}"` in compose.yaml)
The conditional logic preserves local development functionality - when
SKIP_DEV_GEMS is not set, dev/test gems are defined and installed normally.
Fixes: Container startup failures with "Could not find gem 'byebug' in
locally installed gems" error despite using --without development test
0 commit comments