Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

335
Views
How do I define environments for db:environment:set?

I'm trying to set my database environment to staging but I get this error:

$ bin/rails db:environment:set RAILS_ENV=staging
rails aborted!
ActiveRecord::AdapterNotSpecified: database configuration does not specify adapter
/Users/bfruitman/workspace/hired/config/environment.rb:5:in `<top (required)>'
/Users/bfruitman/workspace/hired/bin/rails:9:in `<top (required)>'
/Users/bfruitman/workspace/hired/bin/spring:14:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => db:environment:set => environment
(See full trace by running task with --trace)

I already have an entry in database.yml:

staging:
  <<: *heroku

But that's obviously not good enough. Where should I be defining staging?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

The best way to change your db environment is with psql:

update ar_internal_metadata set value = 'staging' where key = 'environment';

Replace staging with whatever environment you want to use.

over 4 years ago · Santiago Trujillo Report

0

You probably need to add the file: config/environments/staging.rb, it is not included by default, I usually start by copying my production.rb and then making any staging specific changes (if needed).

cp config/environments/production.rb config/environments/staging.rb

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!