Ensure you're on the correct Ruby version:
rbenv local 2.7.8Install deps:
bundle installStart server w/ ENV vars for configuration:
env OTEL_RESOURCE_ATTRIBUTES="highlight.project_id=YOUR_LD_SDK_KEY" OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.observability.app.launchdarkly.com:4318" OTEL_TRACES_EXPORTER="otlp" rails server-
Create a new Codespace on this repo. It will auto-detect
.devcontainerand build the container with Ruby 2.7 and Postgres. -
After the container starts, dependencies and database will be prepared automatically. If needed, run:
bundle install && bundle exec rails db:prepare- Start Rails (port is forwarded automatically):
OTEL_RESOURCE_ATTRIBUTES="highlight.project_id=YOUR_LD_SDK_KEY" \
OTEL_EXPORTER_OTLP_ENDPOINT="https://otel.observability.app.launchdarkly.com:4318" \
OTEL_TRACES_EXPORTER="otlp" \
bundle exec rails server -b 0.0.0.0 -p 3000Or use VS Code Tasks: “Rails: server”.
Database connection in Codespaces is configured via env vars in the devcontainer: DATABASE_HOST=db, DATABASE_USERNAME=postgres, DATABASE_PASSWORD=postgres.
- Build and start containers:
docker compose up --build- Visit http://localhost:3000
Environment is wired for Postgres inside Docker (db:5432). Override OTEL envs as needed:
docker compose run --rm -e OTEL_EXPORTER_OTLP_ENDPOINT=... -e OTEL_RESOURCE_ATTRIBUTES=... app bash