Skip to content

Commit 6fbadd7

Browse files
authored
Rails 8 Part 1 - Bare minimum upgrade (#130)
* Bump rails from 7.2.1.1 to 8.0.1 * Run rails app:update * Manual updates (rails new web --force -d postgresql -c tailwind --skip-solid --skip-kamal --skip-thruster)
1 parent 2d780f4 commit 6fbadd7

File tree

34 files changed

+769
-467
lines changed

34 files changed

+769
-467
lines changed

.dockerignore

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,8 @@
77
# Ignore bundler config.
88
/.bundle
99

10-
# Ignore all environment files (except templates).
10+
# Ignore all environment files.
1111
/.env*
12-
!/.env*.erb
1312

1413
# Ignore all default key files.
1514
/config/master.key

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474

7575
steps:
7676
- name: Install packages
77-
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y google-chrome-stable curl libjemalloc2 libvips postgresql-client
77+
run: sudo apt-get update && sudo apt-get install --no-install-recommends -y build-essential git libpq-dev pkg-config google-chrome-stable
7878

7979
- name: Checkout code
8080
uses: actions/checkout@v4

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
# See https://help.github.com/articles/ignoring-files for more about ignoring files.
22
#
3-
# If you find yourself ignoring temporary files generated by your text editor
4-
# or operating system, you probably want to add a global ignore instead:
5-
# git config --global core.excludesfile '~/.gitignore_global'
3+
# Temporary files generated by your text editor or operating system
4+
# belong in git's global ignore instead:
5+
# `$XDG_CONFIG_HOME/git/ignore` or `~/.config/git/ignore`
66

77
# Ignore bundler config.
88
/.bundle
99

10-
# Ignore all environment files (except templates).
10+
# Ignore all environment files.
1111
/.env*
12-
!/.env*.erb
1312

1413
# Ignore all logfiles and tempfiles.
1514
/log/*

.ruby-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.3.6
1+
ruby-3.3.6

Dockerfile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1-
# syntax = docker/dockerfile:1
1+
# syntax=docker/dockerfile:1
2+
# check=error=true
23

34
# This Dockerfile is designed for production, not development. Use with Kamal or build'n'run by hand:
4-
# docker build -t my-app .
5-
# docker run -d -p 80:80 -p 443:443 --name my-app -e RAILS_MASTER_KEY=<value from config/master.key> my-app
5+
# docker build -t web .
6+
# docker run -d -p 80:3000 -e RAILS_MASTER_KEY=<value from config/master.key> --name web web
7+
8+
# For a containerized dev environment, see Dev Containers: https://guides.rubyonrails.org/getting_started_with_devcontainer.html
69

710
# Make sure RUBY_VERSION matches the Ruby version in .ruby-version
811
ARG RUBY_VERSION=3.3.6

Gemfile

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,23 @@
11
source "https://rubygems.org"
22

33
# Bundle edge Rails instead: gem "rails", github: "rails/rails", branch: "main"
4-
gem "rails", "~> 7.2.1"
5-
4+
gem "rails", "~> 8.0.1"
65
# The original asset pipeline for Rails [https://github.com/rails/sprockets-rails]
76
gem "sprockets-rails"
8-
97
# Use postgresql as the database for Active Record
108
gem "pg", "~> 1.5"
11-
129
# Use the Puma web server [https://github.com/puma/puma]
1310
gem "puma", ">= 5.0"
14-
1511
# Use JavaScript with ESM import maps [https://github.com/rails/importmap-rails]
1612
gem "importmap-rails"
17-
1813
# Hotwire's SPA-like page accelerator [https://turbo.hotwired.dev]
1914
gem "turbo-rails"
20-
2115
# Hotwire's modest JavaScript framework [https://stimulus.hotwired.dev]
2216
gem "stimulus-rails"
23-
2417
# Use Tailwind CSS [https://github.com/rails/tailwindcss-rails]
2518
gem "tailwindcss-rails"
26-
2719
# Build JSON APIs with ease [https://github.com/rails/jbuilder]
2820
gem "jbuilder"
29-
3021
# Use Redis adapter to run Action Cable in production
3122
gem "redis", ">= 4.0.1"
3223

Gemfile.lock

Lines changed: 62 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,67 +1,67 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
actioncable (7.2.1.1)
5-
actionpack (= 7.2.1.1)
6-
activesupport (= 7.2.1.1)
4+
actioncable (8.0.1)
5+
actionpack (= 8.0.1)
6+
activesupport (= 8.0.1)
77
nio4r (~> 2.0)
88
websocket-driver (>= 0.6.1)
99
zeitwerk (~> 2.6)
10-
actionmailbox (7.2.1.1)
11-
actionpack (= 7.2.1.1)
12-
activejob (= 7.2.1.1)
13-
activerecord (= 7.2.1.1)
14-
activestorage (= 7.2.1.1)
15-
activesupport (= 7.2.1.1)
10+
actionmailbox (8.0.1)
11+
actionpack (= 8.0.1)
12+
activejob (= 8.0.1)
13+
activerecord (= 8.0.1)
14+
activestorage (= 8.0.1)
15+
activesupport (= 8.0.1)
1616
mail (>= 2.8.0)
17-
actionmailer (7.2.1.1)
18-
actionpack (= 7.2.1.1)
19-
actionview (= 7.2.1.1)
20-
activejob (= 7.2.1.1)
21-
activesupport (= 7.2.1.1)
17+
actionmailer (8.0.1)
18+
actionpack (= 8.0.1)
19+
actionview (= 8.0.1)
20+
activejob (= 8.0.1)
21+
activesupport (= 8.0.1)
2222
mail (>= 2.8.0)
2323
rails-dom-testing (~> 2.2)
24-
actionpack (7.2.1.1)
25-
actionview (= 7.2.1.1)
26-
activesupport (= 7.2.1.1)
24+
actionpack (8.0.1)
25+
actionview (= 8.0.1)
26+
activesupport (= 8.0.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)
35-
actiontext (7.2.1.1)
36-
actionpack (= 7.2.1.1)
37-
activerecord (= 7.2.1.1)
38-
activestorage (= 7.2.1.1)
39-
activesupport (= 7.2.1.1)
34+
actiontext (8.0.1)
35+
actionpack (= 8.0.1)
36+
activerecord (= 8.0.1)
37+
activestorage (= 8.0.1)
38+
activesupport (= 8.0.1)
4039
globalid (>= 0.6.0)
4140
nokogiri (>= 1.8.5)
42-
actionview (7.2.1.1)
43-
activesupport (= 7.2.1.1)
41+
actionview (8.0.1)
42+
activesupport (= 8.0.1)
4443
builder (~> 3.1)
4544
erubi (~> 1.11)
4645
rails-dom-testing (~> 2.2)
4746
rails-html-sanitizer (~> 1.6)
48-
activejob (7.2.1.1)
49-
activesupport (= 7.2.1.1)
47+
activejob (8.0.1)
48+
activesupport (= 8.0.1)
5049
globalid (>= 0.3.6)
51-
activemodel (7.2.1.1)
52-
activesupport (= 7.2.1.1)
53-
activerecord (7.2.1.1)
54-
activemodel (= 7.2.1.1)
55-
activesupport (= 7.2.1.1)
50+
activemodel (8.0.1)
51+
activesupport (= 8.0.1)
52+
activerecord (8.0.1)
53+
activemodel (= 8.0.1)
54+
activesupport (= 8.0.1)
5655
timeout (>= 0.4.0)
57-
activestorage (7.2.1.1)
58-
actionpack (= 7.2.1.1)
59-
activejob (= 7.2.1.1)
60-
activerecord (= 7.2.1.1)
61-
activesupport (= 7.2.1.1)
56+
activestorage (8.0.1)
57+
actionpack (= 8.0.1)
58+
activejob (= 8.0.1)
59+
activerecord (= 8.0.1)
60+
activesupport (= 8.0.1)
6261
marcel (~> 1.0)
63-
activesupport (7.2.1.1)
62+
activesupport (8.0.1)
6463
base64
64+
benchmark (>= 0.3)
6565
bigdecimal
6666
concurrent-ruby (~> 1.0, >= 1.3.1)
6767
connection_pool (>= 2.2.5)
@@ -71,11 +71,13 @@ GEM
7171
minitest (>= 5.1)
7272
securerandom (>= 0.3)
7373
tzinfo (~> 2.0, >= 2.0.5)
74+
uri (>= 0.13.1)
7475
addressable (2.8.7)
7576
public_suffix (>= 2.0.2, < 7.0)
7677
ast (2.4.2)
7778
base64 (0.2.0)
7879
bcrypt (3.1.20)
80+
benchmark (0.4.0)
7981
bigdecimal (3.1.8)
8082
bindex (0.8.1)
8183
bootsnap (1.18.4)
@@ -97,7 +99,7 @@ GEM
9799
crass (1.0.6)
98100
css_parser (1.19.1)
99101
addressable
100-
date (3.3.4)
102+
date (3.4.1)
101103
debug (1.9.2)
102104
irb (~> 1.10)
103105
reline (>= 0.3.8)
@@ -151,7 +153,7 @@ GEM
151153
mini_mime (1.1.5)
152154
minitest (5.25.1)
153155
msgpack (1.7.3)
154-
net-imap (0.4.17)
156+
net-imap (0.5.1)
155157
date
156158
net-protocol
157159
net-pop (0.1.2)
@@ -183,30 +185,30 @@ GEM
183185
rack (>= 1.3)
184186
rackup (2.2.0)
185187
rack (>= 3)
186-
rails (7.2.1.1)
187-
actioncable (= 7.2.1.1)
188-
actionmailbox (= 7.2.1.1)
189-
actionmailer (= 7.2.1.1)
190-
actionpack (= 7.2.1.1)
191-
actiontext (= 7.2.1.1)
192-
actionview (= 7.2.1.1)
193-
activejob (= 7.2.1.1)
194-
activemodel (= 7.2.1.1)
195-
activerecord (= 7.2.1.1)
196-
activestorage (= 7.2.1.1)
197-
activesupport (= 7.2.1.1)
188+
rails (8.0.1)
189+
actioncable (= 8.0.1)
190+
actionmailbox (= 8.0.1)
191+
actionmailer (= 8.0.1)
192+
actionpack (= 8.0.1)
193+
actiontext (= 8.0.1)
194+
actionview (= 8.0.1)
195+
activejob (= 8.0.1)
196+
activemodel (= 8.0.1)
197+
activerecord (= 8.0.1)
198+
activestorage (= 8.0.1)
199+
activesupport (= 8.0.1)
198200
bundler (>= 1.15.0)
199-
railties (= 7.2.1.1)
201+
railties (= 8.0.1)
200202
rails-dom-testing (2.2.0)
201203
activesupport (>= 5.0.0)
202204
minitest
203205
nokogiri (>= 1.6)
204206
rails-html-sanitizer (1.6.1)
205207
loofah (~> 2.21)
206208
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)
207-
railties (7.2.1.1)
208-
actionpack (= 7.2.1.1)
209-
activesupport (= 7.2.1.1)
209+
railties (8.0.1)
210+
actionpack (= 8.0.1)
211+
activesupport (= 8.0.1)
210212
irb (~> 1.13)
211213
rackup (>= 1.0.0)
212214
rake (>= 12.2)
@@ -278,13 +280,14 @@ GEM
278280
tailwindcss-rails (2.7.9-x86_64-linux)
279281
railties (>= 7.0.0)
280282
thor (1.3.2)
281-
timeout (0.4.1)
283+
timeout (0.4.2)
282284
turbo-rails (2.0.11)
283285
actionpack (>= 6.0.0)
284286
railties (>= 6.0.0)
285287
tzinfo (2.0.6)
286288
concurrent-ruby (~> 1.0)
287289
unicode-display_width (2.6.0)
290+
uri (1.0.2)
288291
useragent (0.16.10)
289292
view_component (3.20.0)
290293
activesupport (>= 5.2.0, < 8.1)
@@ -322,7 +325,7 @@ DEPENDENCIES
322325
lookbook
323326
pg (~> 1.5)
324327
puma (>= 5.0)
325-
rails (~> 7.2.1)
328+
rails (~> 8.0.1)
326329
redis (>= 4.0.1)
327330
rubocop-rails-omakase
328331
selenium-webdriver
Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,4 @@
1-
// Import and register all your controllers from the importmap under controllers/*
2-
1+
// Import and register all your controllers from the importmap via controllers/**/*_controller
32
import { application } from "controllers/application"
4-
5-
// Eager load all controllers defined in the import map under controllers/**/*_controller
63
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading"
74
eagerLoadControllersFrom("controllers", application)
8-
9-
// Lazy load controllers as they appear in the DOM (remember not to preload controllers in import map!)
10-
// import { lazyLoadControllersFrom } from "@hotwired/stimulus-loading"
11-
// lazyLoadControllersFrom("controllers", application)

app/views/layouts/application.html.erb

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,20 @@
44
<title><%= content_for?(:title) ? yield(:title) : "jbakerdev" %></title>
55
<meta name="viewport" content="width=device-width,initial-scale=1">
66
<meta name="apple-mobile-web-app-capable" content="yes">
7+
<meta name="mobile-web-app-capable" content="yes">
78
<%= csrf_meta_tags %>
89
<%= csp_meta_tag %>
910

1011
<%= yield :head %>
1112

12-
<link rel="manifest" href="/manifest.json">
13+
<%# Enable PWA manifest for installable apps (make sure to enable in config/routes.rb too!) %>
14+
<%#= tag.link rel: "manifest", href: pwa_manifest_path(format: :json) %>
15+
1316
<link rel="icon" href="/icon.png" type="image/png">
1417
<link rel="icon" href="/icon.svg" type="image/svg+xml">
1518
<link rel="apple-touch-icon" href="/icon.png">
19+
20+
<%# Includes all stylesheet files in app/assets/stylesheets %>
1621
<%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
1722
<%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
1823
<%= javascript_importmap_tags %>

bin/dev

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,12 @@ if ! gem list foreman -i --silent; then
55
gem install foreman
66
fi
77

8+
# Default to port 3000 if not specified
9+
export PORT="${PORT:-3000}"
10+
11+
# Let the debug gem allow remote connections,
12+
# but avoid loading until `debugger` is called
13+
export RUBY_DEBUG_OPEN="true"
14+
export RUBY_DEBUG_LAZY="true"
15+
816
exec foreman start -f Procfile.dev "$@"

0 commit comments

Comments
 (0)