Skip to content

Spring didn't restart after changes to Gemfile and config/application.rb #611

Open
@matt17r

Description

@matt17r

I had an issue where the dotenv-rails gem wasn't being loaded in my console. After lots of investigating I eventually ran spring stop and that fixed the issue.

In trying to learn more about Spring I've just read the README which says that:

But if we edit any of the files which were used to start the application (configs, initializers, your gemfile), the application needs to be fully restarted. This happens automatically.

In my case this didn't happen... I added the Gem to my Gemfile and spring mustn't have restarted. I later added Dotenv::Railtie.load to config/application.rb and spring still didn't restart.

How can I investigate why these changes weren't detected automagically in my case?

I'm using macOS Catalina, Terminal, and fish shell. I'm using Rails 6.0.2.1 and asdf to manage versions.

My spring.rb file is unchanged from the default (although now I'm wondering if I should add ".tool-versions" to detect changes in Ruby versions from asdf):

Spring.watch(
  ".ruby-version",
  ".rbenv-vars",
  "tmp/restart.txt",
  "tmp/caching-dev.txt"
)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions