Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

340
Vistas
Key is there but I still get `fetch': key not found: "S3_BUCKET_NAME" (KeyError)

I know there's a ton of these asked, but I've tried to follow each one with no luck. There must be some easy mistake that I am overlooking.

I'm trying to set up S3 and Paperclip following the Heroku guide and set up local testing following this Words and Code guide. Every time I try to generate a db migration though I get the error:

config/environments/development.rb:62:in fetch': key not found: "S3_BUCKET_NAME" (KeyError)

These are my files exactly with keys replaced:

development.rb

config.paperlip_defaults = {
    storage: :s3,
    s3_credientials: {
      bucket: ENV.fetch('S3_BUCKET_NAME'),
      access_key_id: ENV.fetch('AWS_ACCESS_KEY_ID'),
      secret_access_key: ENV.fetch('AWS_SECRET_ACCESS_KEY'),
      s3_region: ENV.fetch('AWS_REGION')
    }
  }

.ENV

S3_BUCKET_NAME=some-bucket-name
AWS_ACCESS_KEY_ID=AAAAAABBBBBCCCCCDDDD
AWS_SECRET_ACCESS_KEY=AAAAABBBBBCCCCCDDDDDEEEEE
AWS_REGION=us-east-1

What am I missing?

Edit: I have tried adding the ENV values to my ~/.bashrc and ~/.bash_profle as suggested in this question, with the same error.

over 4 years ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

The answer turned out to be pretty easy with a gem.

I added dotenv-rails to my gemfile

group :development, :test do
  gem 'dotenv-rails'
end

bundle install and good to go.

I guess I never realized that the .env file saved in the root directory wasn't loaded automatically.

over 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda