Skip to content

Commit 25fa603

Browse files
authored
Merge pull request #334 from rails/rm-rails-upgrade
Upgrade to Rails 8.0
2 parents 32a6947 + 91c4afa commit 25fa603

18 files changed

+761
-411
lines changed

Gemfile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,10 @@ ruby '3.3.4'
33
source 'https://rubygems.org'
44
git_source(:github) { |repo| "https://github.com/#{repo}.git" }
55

6-
gem 'rails', '~> 7.2.1'
6+
gem 'rails', '~> 8.0.0'
77

88
gem 'sprockets-rails'
99

10-
gem 'rack', '< 4.0'
1110
gem 'pg'
1211
gem 'puma', '~> 6.0'
1312
gem 'rugged', '1.7.2'

Gemfile.lock

Lines changed: 77 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,68 +1,67 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.2.2.2)
5-
actionpack (= 7.2.2.2)
6-
activesupport (= 7.2.2.2)
4+
actioncable (8.0.2.1)
5+
actionpack (= 8.0.2.1)
6+
activesupport (= 8.0.2.1)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.2.2.2)
11-
actionpack (= 7.2.2.2)
12-
activejob (= 7.2.2.2)
13-
activerecord (= 7.2.2.2)
14-
activestorage (= 7.2.2.2)
15-
activesupport (= 7.2.2.2)
10+
actionmailbox (8.0.2.1)
11+
actionpack (= 8.0.2.1)
12+
activejob (= 8.0.2.1)
13+
activerecord (= 8.0.2.1)
14+
activestorage (= 8.0.2.1)
15+
activesupport (= 8.0.2.1)
1616
mail (>= 2.8.0)
17-
actionmailer (7.2.2.2)
18-
actionpack (= 7.2.2.2)
19-
actionview (= 7.2.2.2)
20-
activejob (= 7.2.2.2)
21-
activesupport (= 7.2.2.2)
17+
actionmailer (8.0.2.1)
18+
actionpack (= 8.0.2.1)
19+
actionview (= 8.0.2.1)
20+
activejob (= 8.0.2.1)
21+
activesupport (= 8.0.2.1)
2222
mail (>= 2.8.0)
2323
rails-dom-testing (~> 2.2)
24-
actionpack (7.2.2.2)
25-
actionview (= 7.2.2.2)
26-
activesupport (= 7.2.2.2)
24+
actionpack (8.0.2.1)
25+
actionview (= 8.0.2.1)
26+
activesupport (= 8.0.2.1)
2727
nokogiri (>= 1.8.5)
28-
racc
29-
rack (>= 2.2.4, < 3.2)
28+
rack (>= 2.2.4)
3029
rack-session (>= 1.0.1)
3130
rack-test (>= 0.6.3)
3231
rails-dom-testing (~> 2.2)
3332
rails-html-sanitizer (~> 1.6)
3433
useragent (~> 0.16)
3534
actionpack-page_caching (1.2.4)
3635
actionpack (>= 4.0.0)
37-
actiontext (7.2.2.2)
38-
actionpack (= 7.2.2.2)
39-
activerecord (= 7.2.2.2)
40-
activestorage (= 7.2.2.2)
41-
activesupport (= 7.2.2.2)
36+
actiontext (8.0.2.1)
37+
actionpack (= 8.0.2.1)
38+
activerecord (= 8.0.2.1)
39+
activestorage (= 8.0.2.1)
40+
activesupport (= 8.0.2.1)
4241
globalid (>= 0.6.0)
4342
nokogiri (>= 1.8.5)
44-
actionview (7.2.2.2)
45-
activesupport (= 7.2.2.2)
43+
actionview (8.0.2.1)
44+
activesupport (= 8.0.2.1)
4645
builder (~> 3.1)
4746
erubi (~> 1.11)
4847
rails-dom-testing (~> 2.2)
4948
rails-html-sanitizer (~> 1.6)
50-
activejob (7.2.2.2)
51-
activesupport (= 7.2.2.2)
49+
activejob (8.0.2.1)
50+
activesupport (= 8.0.2.1)
5251
globalid (>= 0.3.6)
53-
activemodel (7.2.2.2)
54-
activesupport (= 7.2.2.2)
55-
activerecord (7.2.2.2)
56-
activemodel (= 7.2.2.2)
57-
activesupport (= 7.2.2.2)
52+
activemodel (8.0.2.1)
53+
activesupport (= 8.0.2.1)
54+
activerecord (8.0.2.1)
55+
activemodel (= 8.0.2.1)
56+
activesupport (= 8.0.2.1)
5857
timeout (>= 0.4.0)
59-
activestorage (7.2.2.2)
60-
actionpack (= 7.2.2.2)
61-
activejob (= 7.2.2.2)
62-
activerecord (= 7.2.2.2)
63-
activesupport (= 7.2.2.2)
58+
activestorage (8.0.2.1)
59+
actionpack (= 8.0.2.1)
60+
activejob (= 8.0.2.1)
61+
activerecord (= 8.0.2.1)
62+
activesupport (= 8.0.2.1)
6463
marcel (~> 1.0)
65-
activesupport (7.2.2.2)
64+
activesupport (8.0.2.1)
6665
base64
6766
benchmark (>= 0.3)
6867
bigdecimal
@@ -74,6 +73,7 @@ GEM
7473
minitest (>= 5.1)
7574
securerandom (>= 0.3)
7675
tzinfo (~> 2.0, >= 2.0.5)
76+
uri (>= 0.13.1)
7777
airbrussh (1.5.2)
7878
sshkit (>= 1.6.1, != 1.7.0)
7979
base64 (0.3.0)
@@ -112,15 +112,17 @@ GEM
112112
date (3.4.1)
113113
drb (2.2.3)
114114
ed25519 (1.3.0)
115+
erb (5.0.2)
115116
erubi (1.13.1)
116117
execjs (2.10.0)
117118
ffi (1.15.5)
118119
globalid (1.2.1)
119120
activesupport (>= 6.1)
120121
i18n (1.14.7)
121122
concurrent-ruby (~> 1.0)
122-
io-console (0.7.2)
123-
irb (1.14.0)
123+
io-console (0.8.1)
124+
irb (1.15.2)
125+
pp (>= 0.6.0)
124126
rdoc (>= 4.0.0)
125127
reline (>= 0.4.2)
126128
logger (1.7.0)
@@ -136,7 +138,7 @@ GEM
136138
mini_mime (1.1.5)
137139
mini_portile2 (2.8.9)
138140
minitest (5.25.5)
139-
net-imap (0.4.20)
141+
net-imap (0.5.10)
140142
date
141143
net-protocol
142144
net-pop (0.1.2)
@@ -147,41 +149,45 @@ GEM
147149
net-ssh (>= 2.6.5, < 8.0.0)
148150
net-sftp (4.0.0)
149151
net-ssh (>= 5.0.0, < 8.0.0)
150-
net-smtp (0.5.0)
152+
net-smtp (0.5.1)
151153
net-protocol
152154
net-ssh (7.2.3)
153155
nio4r (2.7.4)
154156
nokogiri (1.18.9)
155157
mini_portile2 (~> 2.8.2)
156158
racc (~> 1.4)
157159
pg (1.6.2)
158-
psych (5.1.2)
160+
pp (0.6.2)
161+
prettyprint
162+
prettyprint (0.2.0)
163+
psych (5.2.6)
164+
date
159165
stringio
160166
puma (6.6.1)
161167
nio4r (~> 2.0)
162168
racc (1.8.1)
163-
rack (3.1.16)
169+
rack (3.2.1)
164170
rack-session (2.1.1)
165171
base64 (>= 0.1.0)
166172
rack (>= 3.0.0)
167173
rack-test (2.2.0)
168174
rack (>= 1.3)
169175
rackup (2.2.1)
170176
rack (>= 3)
171-
rails (7.2.2.2)
172-
actioncable (= 7.2.2.2)
173-
actionmailbox (= 7.2.2.2)
174-
actionmailer (= 7.2.2.2)
175-
actionpack (= 7.2.2.2)
176-
actiontext (= 7.2.2.2)
177-
actionview (= 7.2.2.2)
178-
activejob (= 7.2.2.2)
179-
activemodel (= 7.2.2.2)
180-
activerecord (= 7.2.2.2)
181-
activestorage (= 7.2.2.2)
182-
activesupport (= 7.2.2.2)
177+
rails (8.0.2.1)
178+
actioncable (= 8.0.2.1)
179+
actionmailbox (= 8.0.2.1)
180+
actionmailer (= 8.0.2.1)
181+
actionpack (= 8.0.2.1)
182+
actiontext (= 8.0.2.1)
183+
actionview (= 8.0.2.1)
184+
activejob (= 8.0.2.1)
185+
activemodel (= 8.0.2.1)
186+
activerecord (= 8.0.2.1)
187+
activestorage (= 8.0.2.1)
188+
activesupport (= 8.0.2.1)
183189
bundler (>= 1.15.0)
184-
railties (= 7.2.2.2)
190+
railties (= 8.0.2.1)
185191
rails-controller-testing (1.0.5)
186192
actionpack (>= 5.0.1.rc1)
187193
actionview (>= 5.0.1.rc1)
@@ -193,22 +199,23 @@ GEM
193199
rails-html-sanitizer (1.6.2)
194200
loofah (~> 2.21)
195201
nokogiri (>= 1.15.7, != 1.16.7, != 1.16.6, != 1.16.5, != 1.16.4, != 1.16.3, != 1.16.2, != 1.16.1, != 1.16.0.rc1, != 1.16.0)
196-
railties (7.2.2.2)
197-
actionpack (= 7.2.2.2)
198-
activesupport (= 7.2.2.2)
202+
railties (8.0.2.1)
203+
actionpack (= 8.0.2.1)
204+
activesupport (= 8.0.2.1)
199205
irb (~> 1.13)
200206
rackup (>= 1.0.0)
201207
rake (>= 12.2)
202208
thor (~> 1.0, >= 1.2.2)
203209
zeitwerk (~> 2.6)
204-
rake (13.2.1)
210+
rake (13.3.0)
205211
rbnacl (7.1.1)
206212
ffi
207213
rbnacl-libsodium (1.0.16)
208214
rbnacl (>= 3.0.1)
209-
rdoc (6.7.0)
215+
rdoc (6.14.2)
216+
erb
210217
psych (>= 4.0.0)
211-
reline (0.5.9)
218+
reline (0.6.2)
212219
io-console (~> 0.5)
213220
rugged (1.7.2)
214221
sass-rails (6.0.0)
@@ -235,7 +242,7 @@ GEM
235242
net-sftp (>= 2.1.2)
236243
net-ssh (>= 2.8.0)
237244
stringio (3.1.7)
238-
thor (1.3.1)
245+
thor (1.4.0)
239246
tilt (2.0.11)
240247
timeout (0.4.3)
241248
turbolinks (5.2.1)
@@ -246,16 +253,18 @@ GEM
246253
uglifier (4.2.1)
247254
execjs (>= 0.3.0, < 3)
248255
unf (0.2.0)
256+
uri (1.0.3)
249257
useragent (0.16.11)
250258
web-console (4.2.1)
251259
actionview (>= 6.0.0)
252260
activemodel (>= 6.0.0)
253261
bindex (>= 0.4.0)
254262
railties (>= 6.0.0)
255-
websocket-driver (0.7.6)
263+
websocket-driver (0.8.0)
264+
base64
256265
websocket-extensions (>= 0.1.0)
257266
websocket-extensions (0.1.5)
258-
zeitwerk (2.6.17)
267+
zeitwerk (2.7.3)
259268

260269
PLATFORMS
261270
ruby
@@ -271,8 +280,7 @@ DEPENDENCIES
271280
ed25519
272281
pg
273282
puma (~> 6.0)
274-
rack (< 4.0)
275-
rails (~> 7.2.1)
283+
rails (~> 8.0.0)
276284
rails-controller-testing
277285
rbnacl (>= 3.2, < 8.0)
278286
rbnacl-libsodium

bin/dev

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/usr/bin/env ruby
2+
exec "./bin/rails", "server", *ARGV

bin/setup

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
require "fileutils"
33

44
APP_ROOT = File.expand_path("..", __dir__)
5-
APP_NAME = "rails-contributors"
65

76
def system!(*args)
87
system(*args, exception: true)
@@ -14,7 +13,6 @@ FileUtils.chdir APP_ROOT do
1413
# Add necessary setup steps to this file.
1514

1615
puts "== Installing dependencies =="
17-
system! "gem install bundler --conservative"
1816
system("bundle check") || system!("bundle install")
1917

2018
# puts "\n== Copying sample files =="
@@ -28,10 +26,9 @@ FileUtils.chdir APP_ROOT do
2826
puts "\n== Removing old logs and tempfiles =="
2927
system! "bin/rails log:clear tmp:clear"
3028

31-
puts "\n== Restarting application server =="
32-
system! "bin/rails restart"
33-
34-
# puts "\n== Configuring puma-dev =="
35-
# system "ln -nfs #{APP_ROOT} ~/.puma-dev/#{APP_NAME}"
36-
# system "curl -Is https://#{APP_NAME}.test/up | head -n 1"
29+
unless ARGV.include?("--skip-server")
30+
puts "\n== Starting development server =="
31+
STDOUT.flush # flush the output before exec(2) so that it displays
32+
exec "bin/dev"
33+
end
3734
end

config/environments/development.rb

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,7 @@
33
Rails.application.configure do
44
# Settings specified here will take precedence over those in config/application.rb.
55

6-
# In the development environment your application's code is reloaded any time
7-
# it changes. This slows down response time but is perfect for development
8-
# since you don't have to restart the web server when you make code changes.
6+
# Make code changes take effect immediately without server restart.
97
config.enable_reloading = true
108

119
# Do not eager load code on boot.
@@ -17,35 +15,31 @@
1715
# Enable server timing.
1816
config.server_timing = true
1917

20-
# Enable/disable caching. By default caching is disabled.
21-
# Run rails dev:cache to toggle caching.
18+
# Enable/disable Action Controller caching. By default Action Controller caching is disabled.
19+
# Run rails dev:cache to toggle Action Controller caching.
2220
if Rails.root.join("tmp/caching-dev.txt").exist?
2321
config.action_controller.perform_caching = true
2422
config.action_controller.enable_fragment_cache_logging = true
25-
26-
config.cache_store = :memory_store
27-
config.public_file_server.headers = { "Cache-Control" => "public, max-age=#{2.days.to_i}" }
23+
config.public_file_server.headers = { "cache-control" => "public, max-age=#{2.days.to_i}" }
2824
else
2925
config.action_controller.perform_caching = false
30-
31-
config.cache_store = :null_store
3226
end
3327

28+
# Change to :null_store to avoid any caching.
29+
config.cache_store = :memory_store
30+
3431
# Print deprecation notices to the Rails logger.
3532
config.active_support.deprecation = :log
3633

37-
# Raise exceptions for disallowed deprecations.
38-
config.active_support.disallowed_deprecation = :raise
39-
40-
# Tell Active Support which deprecation messages to disallow.
41-
config.active_support.disallowed_deprecation_warnings = []
42-
4334
# Raise an error on page load if there are pending migrations.
4435
config.active_record.migration_error = :page_load
4536

4637
# Highlight code that triggered database queries in logs.
4738
config.active_record.verbose_query_logs = true
4839

40+
# Append comments with runtime information tags to SQL queries in logs.
41+
config.active_record.query_log_tags_enabled = true
42+
4943
# Debug mode disables concatenation and preprocessing of assets.
5044
# This option may cause significant delays in view rendering with a large
5145
# number of complex assets.

0 commit comments

Comments
 (0)