Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

342
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda