From 361e4e08a6557170aef0483ebb863b11f6d1417f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Wed, 22 Oct 2025 21:10:49 +0200 Subject: [PATCH] Explicitly add csv to Gemfile We were getting a warning on staging and production environments: ``` app/models/local_census_records/import.rb:1: warning: csv was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.4.0. You can add csv to your Gemfile or gemspec to silence this warning ``` The reason we weren't getting this warning during development is that we do have `csv` in our `Gemfile.lock`, but only in development environments, since it's an indirect dependency of pronto. On production environments, we don't install pronto or its dependencies, though. We can reproduce the warning locally by temporarily removing the pronto gems from the Gemfile, running `bundle install` and starting a rails console. --- Gemfile | 1 + Gemfile.lock | 1 + app/models/budget/investment/exporter.rb | 1 - app/models/local_census_records/import.rb | 2 -- 4 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Gemfile b/Gemfile index 88eb0e18c..7e3cd0757 100644 --- a/Gemfile +++ b/Gemfile @@ -17,6 +17,7 @@ gem "caxlsx", "~> 4.2.0" gem "caxlsx_rails", "~> 0.6.4" gem "ckeditor", "~> 4.3.0" gem "cocoon", "~> 1.2.15" +gem "csv", "~> 3.3.5" gem "daemons", "~> 1.4.1" gem "dalli", "~> 3.2.8" gem "delayed_job_active_record", "~> 4.1.11" diff --git a/Gemfile.lock b/Gemfile.lock index c8fae07ad..748939353 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -820,6 +820,7 @@ DEPENDENCIES caxlsx_rails (~> 0.6.4) ckeditor (~> 4.3.0) cocoon (~> 1.2.15) + csv (~> 3.3.5) daemons (~> 1.4.1) dalli (~> 3.2.8) debug (~> 1.9.2) diff --git a/app/models/budget/investment/exporter.rb b/app/models/budget/investment/exporter.rb index 6ba272ab2..efe7576f1 100644 --- a/app/models/budget/investment/exporter.rb +++ b/app/models/budget/investment/exporter.rb @@ -1,5 +1,4 @@ class Budget::Investment::Exporter - require "csv" include JsonExporter def initialize(investments) diff --git a/app/models/local_census_records/import.rb b/app/models/local_census_records/import.rb index e7d09a96b..23f6325bf 100644 --- a/app/models/local_census_records/import.rb +++ b/app/models/local_census_records/import.rb @@ -1,5 +1,3 @@ -require "csv" - class LocalCensusRecords::Import include ActiveModel::Model