You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Great work with this! I'd love to get it working fully for my project in VS Code.
My project uses spring to reload the development environment on code changes. When I use the CodeLens Run or Run in Terminal commands, they fail like this:
💥 bundle exec bin/rspec /Users/daniel/myproject/my_spec.rb
/Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/spring-4.1.3/lib/spring/application.rb:100:in `block in preload': Spring reloads, and therefore needs the application to have reloading enabled.
Please, set config.cache_classes to false in config/environments/test.rb.
(RuntimeError)
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `instance_exec'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:32:in `run'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:61:in `block in run_initializers'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:228:in `block in tsort_each'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:350:in `block (2 levels) in each_strongly_connected_component'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:431:in `each_strongly_connected_component_from'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:349:in `block in each_strongly_connected_component'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `call'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:347:in `each_strongly_connected_component'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:226:in `tsort_each'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/tsort.rb:205:in `tsort_each'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/railties-7.0.8/lib/rails/initializable.rb:60:in `run_initializers'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/railties-7.0.8/lib/rails/application.rb:372:in `initialize!'
from /Users/daniel/docker/tatou/api/config/environment.rb:5:in `<main>'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/bootsnap-1.17.1/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/zeitwerk-2.6.12/lib/zeitwerk/kernel.rb:38:in `require'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/spring-4.1.3/lib/spring/application.rb:107:in `preload'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/spring-4.1.3/lib/spring/application.rb:166:in `serve'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/spring-4.1.3/lib/spring/application.rb:148:in `block in run'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/spring-4.1.3/lib/spring/application.rb:142:in `loop'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/spring-4.1.3/lib/spring/application.rb:142:in `run'
from /Users/daniel/.rbenv/versions/3.1.4/lib/ruby/gems/3.1.0/gems/spring-4.1.3/lib/spring/application/boot.rb:19:in `<top (required)>'
from <internal:/Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from <internal:/Users/daniel/.rbenv/versions/3.1.4/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
from -e:1:in `<main>'
but I can make the same command work in my terminal by putting an environment variable at the start:
Great work with this! I'd love to get it working fully for my project in VS Code.
My project uses
spring
to reload the development environment on code changes. When I use the CodeLens Run or Run in Terminal commands, they fail like this:but I can make the same command work in my terminal by putting an environment variable at the start:
This is a workaround I picked up from other projects, e.g. ruby-debug/ruby-debug-ide#152 (comment)
Is there a way to customise the command this gem uses to run RSpec?
The text was updated successfully, but these errors were encountered: