Skip to content

Instantly share code, notes, and snippets.

@blairanderson
Forked from theinventor/setup-script.sh
Last active October 15, 2025 02:46
Show Gist options
  • Select an option

  • Save blairanderson/6bc74efbc707ca5e2a431b065acb0252 to your computer and use it in GitHub Desktop.

Select an option

Save blairanderson/6bc74efbc707ca5e2a431b065acb0252 to your computer and use it in GitHub Desktop.
openai codex rails setup
# get your RAILS_MASTER_KEY from cat config/credentials/development.key
# get your SECRET_KEY_BASE from cat tmp/local_secret.txt
# save BOTH as env because Secrets are only available during setup
# https://developers.openai.com/codex/cloud/environments#environment-variables-and-secrets
apt-get update
apt-get install -y postgresql postgresql-contrib libpq-dev
sudo service postgresql start
sudo -u postgres createuser --superuser root
sudo -u postgres psql -c "ALTER ROLE root LOGIN;"
sudo -u postgres psql -c "ALTER ROLE root CREATEDB;"
apt-get install -y redis-server
sudo service redis-server start
sudo service redis-server status
gem install bundler -v 2.6.5
apt-get install -y libyaml-dev
gem install foreman
bundle install
bin/rails db:prepare
# something to test your seeds loaded
bin/rails runner "puts City.count"
bun install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment