Skip to content

[dotenv] Loaded comment gets added to routes annotations #288

@sebaherrera07

Description

@sebaherrera07

I am running annotaterb (4.20.0) on my Ruby (3.4.6) and Rails (8.1.0) web application. I am also running dotenv (3.1.8).

Any time I annotate the routes with bundle exec annotaterb routes, the annotations end up with some stuff that shouldn't be there. Previously, it was:

# == Route Map
#
# [dotenv] Loaded �[33m.env�[0m
# Routes for application:
...

But now it is:

# == Route Map
#
# [dotenv] Loaded �[33m.env�[0m
# W, [2025-10-28T10:51:14.428860 #11045]  WARN -- : Generating image variants require the image_processing gem. Please add `gem "image_processing", "~> 1.2"` to your Gemfile or set `config.active_storage.variant_processor = :disabled`.
# Routes for application:
...

Any ideas what may be happening, or how to prevent this?

My .annotaterb.yml file contains:

---
:position: before
:position_in_additional_file_patterns: before
:position_in_class: before
:position_in_factory: before
:position_in_fixture: before
:position_in_routes: before
:position_in_serializer: before
:position_in_test: before
:classified_sort: true
:exclude_controllers: true
:exclude_factories: false
:exclude_fixtures: false
:exclude_helpers: true
:exclude_scaffolds: true
:exclude_serializers: false
:exclude_sti_subclasses: false
:exclude_tests: true
:force: false
:format_markdown: false
:format_rdoc: false
:format_yard: false
:frozen: false
:ignore_model_sub_dir: false
:ignore_unknown_models: false
:include_version: false
:show_check_constraints: false
:show_complete_foreign_keys: false
:show_foreign_keys: true
:show_indexes: true
:simple_indexes: false
:sort: false
:timestamp: false
:trace: false
:with_comment: true
:with_column_comments: true
:with_table_comments: true
:active_admin: false
:command:
:debug: false
:hide_default_column_types: ''
:hide_limit_column_types: ''
:ignore_columns:
:ignore_routes:
:models: true
:routes: false
:skip_on_db_migrate: false
:target_action: :do_annotations
:wrapper:
:wrapper_close:
:wrapper_open:
:classes_default_to_s: []
:additional_file_patterns: []
:model_dir:
- app/models
:require: []
:root_dir:
- ''

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions