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

287
Vistas
'# frozen_string_literal: true' is really needed in a rails application??? do i need to put it in each file?

Every file of my rails app i'm editing displays this warning, missing frozen string literal comment, i know this is used to reserve memory and avoid memory re-allocation for all strings literal, but is it necessary to use on rails or its enabled by default? if so, how to enable it globally?

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

0

Nope, it's not enabled by default.

However, you may use Rubocop to append it to the top of your files with Rubocop::Cop::Style::FrozenStringLiteralComment. It's an auto-correctable cop.

According to Holger Just:

You can actually enable it globally by invoking the ruby interpreter with ruby --enable=frozen-string-literal. However, this is usually a bad idea and will break in various subtle ways unless you are very sure that all files in all your gems and dependencies actually expect frozen literals (which is generally not the case)

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