Skip to content

using spring does not work from subdirectories #644

@ccutrer

Description

@ccutrer

having a rails project with a spec directory:

spring rspec lib/acts_as_list_spec.rb
>> Spring was unable to find your config/application.rb file. Your project root was detected at /Users/cody/src/canvas-lms/spec, so Spring looked for /Users/cody/src/canvas-lms/spec/config/application.rb but it doesn't exist. You can configure the root of your application by setting Spring.application_root in config/spring.rb.

But non-springified works fine, properly searching the parent dir for the Gemfile, and then booting the app.

I've explored this quite a bit by monkey patching, and even if you can get the Spring client to boot via enough tricks, the server will still try to launch from the wrong directory and throw the same error. If you're sneaky and boot the server from the actual project root, and then run spring rspec from the spec directory, it will not have the some working directory, and just be confusing. It seems like the server needs to be directory aware - having the client pass its working directory through, and the server changing to that before running the command.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions