Skip to content

Commit 1d5db17

Browse files
committed
upgrade to rails 8.0
1 parent 31270c4 commit 1d5db17

19 files changed

+725
-453
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ gem "shakapacker", "8.0.0"
1010

1111
# Bundle edge Rails instead: gem "rails", github: "rails/rails"
1212
gem "listen"
13-
gem "rails", "~> 7.2"
13+
gem "rails", "~> 8.0"
1414

1515
gem "pg"
1616

Gemfile.lock

+57-56
Original file line numberDiff line numberDiff line change
@@ -7,66 +7,65 @@ GIT
77
GEM
88
remote: https://rubygems.org/
99
specs:
10-
actioncable (7.2.2)
11-
actionpack (= 7.2.2)
12-
activesupport (= 7.2.2)
10+
actioncable (8.0.0)
11+
actionpack (= 8.0.0)
12+
activesupport (= 8.0.0)
1313
nio4r (~> 2.0)
1414
websocket-driver (>= 0.6.1)
1515
zeitwerk (~> 2.6)
16-
actionmailbox (7.2.2)
17-
actionpack (= 7.2.2)
18-
activejob (= 7.2.2)
19-
activerecord (= 7.2.2)
20-
activestorage (= 7.2.2)
21-
activesupport (= 7.2.2)
16+
actionmailbox (8.0.0)
17+
actionpack (= 8.0.0)
18+
activejob (= 8.0.0)
19+
activerecord (= 8.0.0)
20+
activestorage (= 8.0.0)
21+
activesupport (= 8.0.0)
2222
mail (>= 2.8.0)
23-
actionmailer (7.2.2)
24-
actionpack (= 7.2.2)
25-
actionview (= 7.2.2)
26-
activejob (= 7.2.2)
27-
activesupport (= 7.2.2)
23+
actionmailer (8.0.0)
24+
actionpack (= 8.0.0)
25+
actionview (= 8.0.0)
26+
activejob (= 8.0.0)
27+
activesupport (= 8.0.0)
2828
mail (>= 2.8.0)
2929
rails-dom-testing (~> 2.2)
30-
actionpack (7.2.2)
31-
actionview (= 7.2.2)
32-
activesupport (= 7.2.2)
30+
actionpack (8.0.0)
31+
actionview (= 8.0.0)
32+
activesupport (= 8.0.0)
3333
nokogiri (>= 1.8.5)
34-
racc
35-
rack (>= 2.2.4, < 3.2)
34+
rack (>= 2.2.4)
3635
rack-session (>= 1.0.1)
3736
rack-test (>= 0.6.3)
3837
rails-dom-testing (~> 2.2)
3938
rails-html-sanitizer (~> 1.6)
4039
useragent (~> 0.16)
41-
actiontext (7.2.2)
42-
actionpack (= 7.2.2)
43-
activerecord (= 7.2.2)
44-
activestorage (= 7.2.2)
45-
activesupport (= 7.2.2)
40+
actiontext (8.0.0)
41+
actionpack (= 8.0.0)
42+
activerecord (= 8.0.0)
43+
activestorage (= 8.0.0)
44+
activesupport (= 8.0.0)
4645
globalid (>= 0.6.0)
4746
nokogiri (>= 1.8.5)
48-
actionview (7.2.2)
49-
activesupport (= 7.2.2)
47+
actionview (8.0.0)
48+
activesupport (= 8.0.0)
5049
builder (~> 3.1)
5150
erubi (~> 1.11)
5251
rails-dom-testing (~> 2.2)
5352
rails-html-sanitizer (~> 1.6)
54-
activejob (7.2.2)
55-
activesupport (= 7.2.2)
53+
activejob (8.0.0)
54+
activesupport (= 8.0.0)
5655
globalid (>= 0.3.6)
57-
activemodel (7.2.2)
58-
activesupport (= 7.2.2)
59-
activerecord (7.2.2)
60-
activemodel (= 7.2.2)
61-
activesupport (= 7.2.2)
56+
activemodel (8.0.0)
57+
activesupport (= 8.0.0)
58+
activerecord (8.0.0)
59+
activemodel (= 8.0.0)
60+
activesupport (= 8.0.0)
6261
timeout (>= 0.4.0)
63-
activestorage (7.2.2)
64-
actionpack (= 7.2.2)
65-
activejob (= 7.2.2)
66-
activerecord (= 7.2.2)
67-
activesupport (= 7.2.2)
62+
activestorage (8.0.0)
63+
actionpack (= 8.0.0)
64+
activejob (= 8.0.0)
65+
activerecord (= 8.0.0)
66+
activesupport (= 8.0.0)
6867
marcel (~> 1.0)
69-
activesupport (7.2.2)
68+
activesupport (8.0.0)
7069
base64
7170
benchmark (>= 0.3)
7271
bigdecimal
@@ -78,6 +77,7 @@ GEM
7877
minitest (>= 5.1)
7978
securerandom (>= 0.3)
8079
tzinfo (~> 2.0, >= 2.0.5)
80+
uri (>= 0.13.1)
8181
addressable (2.8.7)
8282
public_suffix (>= 2.0.2, < 7.0)
8383
ast (2.4.2)
@@ -244,20 +244,20 @@ GEM
244244
rackup (2.1.0)
245245
rack (>= 3)
246246
webrick (~> 1.8)
247-
rails (7.2.2)
248-
actioncable (= 7.2.2)
249-
actionmailbox (= 7.2.2)
250-
actionmailer (= 7.2.2)
251-
actionpack (= 7.2.2)
252-
actiontext (= 7.2.2)
253-
actionview (= 7.2.2)
254-
activejob (= 7.2.2)
255-
activemodel (= 7.2.2)
256-
activerecord (= 7.2.2)
257-
activestorage (= 7.2.2)
258-
activesupport (= 7.2.2)
247+
rails (8.0.0)
248+
actioncable (= 8.0.0)
249+
actionmailbox (= 8.0.0)
250+
actionmailer (= 8.0.0)
251+
actionpack (= 8.0.0)
252+
actiontext (= 8.0.0)
253+
actionview (= 8.0.0)
254+
activejob (= 8.0.0)
255+
activemodel (= 8.0.0)
256+
activerecord (= 8.0.0)
257+
activestorage (= 8.0.0)
258+
activesupport (= 8.0.0)
259259
bundler (>= 1.15.0)
260-
railties (= 7.2.2)
260+
railties (= 8.0.0)
261261
rails-dom-testing (2.2.0)
262262
activesupport (>= 5.0.0)
263263
minitest
@@ -273,9 +273,9 @@ GEM
273273
json
274274
require_all (~> 3.0)
275275
ruby-progressbar
276-
railties (7.2.2)
277-
actionpack (= 7.2.2)
278-
activesupport (= 7.2.2)
276+
railties (8.0.0)
277+
actionpack (= 8.0.0)
278+
activesupport (= 8.0.0)
279279
irb (~> 1.13)
280280
rackup (>= 1.0.0)
281281
rake (>= 12.2)
@@ -417,6 +417,7 @@ GEM
417417
uglifier (4.2.0)
418418
execjs (>= 0.3.0, < 3)
419419
unicode-display_width (2.5.0)
420+
uri (1.0.2)
420421
useragent (0.16.10)
421422
web-console (4.2.1)
422423
actionview (>= 6.0.0)
@@ -462,7 +463,7 @@ DEPENDENCIES
462463
pry-rescue
463464
pry-stack_explorer
464465
puma
465-
rails (~> 7.2)
466+
rails (~> 8.0)
466467
rails-html-sanitizer
467468
rails_best_practices
468469
rainbow

bin/dev

+1-29
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,2 @@
11
#!/usr/bin/env ruby
2-
# frozen_string_literal: true
3-
4-
def installed?(process)
5-
IO.popen "#{process} -v"
6-
rescue Errno::ENOENT
7-
false
8-
end
9-
10-
def run(process)
11-
system "#{process} start -f Procfile.dev"
12-
rescue Errno::ENOENT
13-
warn <<~MSG
14-
ERROR:
15-
Please ensure `Procfile.dev` exists in your project!
16-
MSG
17-
exit!
18-
end
19-
20-
if installed? "overmind"
21-
run "overmind"
22-
elsif installed? "foreman"
23-
run "foreman"
24-
else
25-
warn <<~MSG
26-
NOTICE:
27-
For this script to run, you need either 'overmind' or 'foreman' installed on your machine. Please try this script after installing one of them.
28-
MSG
29-
exit!
30-
end
2+
exec "./bin/rails", "server", *ARGV

bin/setup

+5-8
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-react-tutorial"
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

bin/thrust

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/usr/bin/env ruby
2+
require "rubygems"
3+
require "bundler/setup"
4+
5+
load Gem.bin_path("thruster", "thrust")

config/environments/development.rb

+12-21
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,53 +15,46 @@
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
# Store uploaded files on the local file system (see config/storage.yml for options).
3532
config.active_storage.service = :local
3633

3734
# Don't care if the mailer can't send.
3835
config.action_mailer.raise_delivery_errors = false
3936

40-
# Disable caching for Action Mailer templates even if Action Controller
41-
# caching is enabled.
37+
# Make template changes take effect immediately.
4238
config.action_mailer.perform_caching = false
4339

40+
# Set localhost to be used by links generated in mailer templates.
4441
config.action_mailer.default_url_options = { host: "localhost", port: 3000 }
4542

4643
# Print deprecation notices to the Rails logger.
4744
config.active_support.deprecation = :log
4845

49-
# Raise exceptions for disallowed deprecations.
50-
config.active_support.disallowed_deprecation = :raise
51-
52-
# Tell Active Support which deprecation messages to disallow.
53-
config.active_support.disallowed_deprecation_warnings = []
54-
5546
# Raise an error on page load if there are pending migrations.
5647
config.active_record.migration_error = :page_load
5748

5849
# Highlight code that triggered database queries in logs.
5950
config.active_record.verbose_query_logs = true
6051

52+
# Append comments with runtime information tags to SQL queries in logs.
53+
config.active_record.query_log_tags_enabled = true
54+
6155
# Highlight code that enqueued background job in logs.
6256
config.active_job.verbose_enqueue_logs = true
6357

64-
# Suppress logger output for asset requests.
65-
config.assets.quiet = true
66-
6758
# Raises error for missing translations.
6859
# config.i18n.raise_on_missing_translations = true
6960

0 commit comments

Comments
 (0)