Initial Rails Setup
Initial Rails Setup#
After cloning an existing Rails app, start with the project’s own binstubs.
bundle install
bin/rails db:prepare
bin/rails server
bin/rails db:prepare creates the database, loads the schema, and runs pending migrations when needed.
Environment Variables#
Keep secrets and environment-specific values outside the repository. For example:
export SECRET_KEY_BASE="change-me"
export DATABASE_URL="postgres://user:password@localhost/app_development"
Do not hard-code production secrets in shell startup files committed to a project.
Assets#
Avoid enabling runtime asset compilation in production unless you have a specific reason. Precompile assets during deployment instead:
RAILS_ENV=production bin/rails assets:precompile