Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spring binstub modifier does not check for class presence #695

Open
jjb opened this issue Mar 24, 2023 · 1 comment
Open

spring binstub modifier does not check for class presence #695

jjb opened this issue Mar 24, 2023 · 1 comment

Comments

@jjb
Copy link

jjb commented Mar 24, 2023

thanks for a great project!

The docs say this command bundle exec spring binstub --all should produce this:

begin
  load File.expand_path('../spring', __FILE__)
...

But that's not what i'm seeing in my rails 6.1 app

it simply produced this in bin/rails and bin/rake

 #!/usr/bin/env ruby
+load File.expand_path("spring", __dir__)

it does also generate bin/spring which has some checking logic, so maybe that's the expected behavior and the readme just needs to be updated

if !defined?(Spring)
......

i'm noticing this because i'm running into the problem where

  1. i have spring in development in Gemfile
  2. running something like RAILS_ENV=test rails db:migrate still gives me the Please, set config.cache_classes to false in config/environments/test.rb message

so i'm not sure what is the correct way to not use spring in my local test environment (i think something is happening like, the gem gets installed locally, isn't in the bundle, but the binstub is loading it outside of the logic of bundler?)

@jjb
Copy link
Author

jjb commented Apr 10, 2023

this array was generated with "test", which i removed

if !defined?(Spring) && [nil, "development"].include?(ENV["RAILS_ENV"])

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant