Skip to content

Commit

Permalink
Include Rails environment as task dependency (#1205)
Browse files Browse the repository at this point in the history
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://raw.githubusercontent.com/thoughtbot/suspenders/main/lib/install/web.rb
  • Loading branch information
stevepolitodesign authored May 15, 2024
1 parent 17c3745 commit 7a4ed01
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/tasks/suspenders.rake
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 7a4ed01

Please sign in to comment.