Skip to content

Rails no longer recommends Spring by default. Let's remove it #3231

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

Merged
merged 7 commits into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ jobs:
- name: Run Tests
env:
RAILS_ENV: test
DISABLE_SPRING: "true"
run: |
bundle exec rails db:create db:schema:load
bundle exec rails test
Expand Down
6 changes: 1 addition & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,8 @@ group :development do

gem 'better_errors', '>= 2.3.0'
gem 'binding_of_caller'

gem 'brakeman'

gem 'listen', '>= 3.0.5', '< 3.9'
Copy link
Member

@pgwillia pgwillia Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Seems like listen is still needed.

# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bootsnap gem has no dependency on Listen. Maybe it's a caching thing 🤔. Wonder if you blow away your tmp directory if that fixes it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Listen was in the gem in 6.1.7+ in Rails with Spring but was removed in 7.0 (so unless Rails needs it for some reason? But this was working for me)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's the config.file_watcher = ActiveSupport::EventedFileUpdateChecker in the development environment.

Copy link
Contributor Author

@murny murny Sep 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, never mind I'm getting same error when I run the server (tests work fine surprisingly). Let's put listen back in, and we can remove listen in Rails 7. My assumption is Rails uses Listen for hot reload in development mode. Thanks for checking!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay Listen is back!

gem 'spring'
gem 'spring-watcher-listen', '~> 2.1.0'
gem 'listen'

gem 'web-console', '>= 4.1.0'
end
Expand Down
8 changes: 1 addition & 7 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -572,10 +572,6 @@ GEM
sparql-client (3.2.0)
net-http-persistent (~> 4.0, >= 4.0.1)
rdf (~> 3.2)
spring (4.1.1)
spring-watcher-listen (2.1.0)
listen (>= 2.7, < 4.0)
spring (>= 4)
sprockets (4.2.1)
concurrent-ruby (~> 1.0)
rack (>= 2.2.4, < 4)
Expand Down Expand Up @@ -662,7 +658,7 @@ DEPENDENCIES
json-schema (~> 4.1.1)
kaminari
launchy
listen (>= 3.0.5, < 3.9)
listen
minitest-retry
nokogiri
oaisys!
Expand Down Expand Up @@ -698,8 +694,6 @@ DEPENDENCIES
sidekiq-unique-jobs (~> 8.0)
simple_form
simplecov
spring
spring-watcher-listen (~> 2.1.0)
strong_migrations (~> 1.6.3)
uuidtools
vcr (= 5.0)
Expand Down
5 changes: 0 additions & 5 deletions bin/rails
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('spring', __dir__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
APP_PATH = File.expand_path('../config/application', __dir__)
require_relative '../config/boot'
require 'rails/commands'
5 changes: 0 additions & 5 deletions bin/rake
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
#!/usr/bin/env ruby
begin
load File.expand_path('spring', __dir__)
rescue LoadError => e
raise unless e.message.include?('spring')
end
require_relative '../config/boot'
require 'rake'
Rake.application.run
15 changes: 0 additions & 15 deletions bin/spring

This file was deleted.

6 changes: 0 additions & 6 deletions config/spring.rb

This file was deleted.