Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
小規模個人アプリをRails 7.xにバージョンアップした話
Search
Kazuhiro NISHIYAMA
November 27, 2023
Technology
0
17
小規模個人アプリをRails 7.xにバージョンアップした話
[【出張版】Kyoto.rb Meetup 【大阪だよ】](
https://kyotorb.connpass.com/event/296972/)のLT大会での発表資料です
。
Kazuhiro NISHIYAMA
November 27, 2023
Tweet
Share
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Ubuntuのriscv64版をqemuで動かした
znz
0
10
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
27
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
81
Rubyist Magazine Reboot
znz
0
82
History of Japanese Ruby reference manual, and future
znz
0
1.4k
qemuのriscv64にDebianを入れてみた
znz
0
88
systemd 再入門
znz
0
280
Ruby 3.0.0 コネタ集
znz
0
260
livedoor天気API終了対応
znz
0
250
Other Decks in Technology
See All in Technology
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
5
38k
エンジニアゼロの組織から内製開発の DX をどう実現したのか / How did we achieve DX in in-house development in an organization with zero engineers?
genkiogasawara
7
3.1k
TypeScript の抽象構文木を用いた、数百を超える API の大規模リファクタリング戦略
yanaemon
6
1.3k
iThome2024 Wailing Wall of Enterprise Security
notsurprised
0
300
Blazor WASM × Code-first gRPC で始める C# ⼤統⼀理論
sansantech
PRO
1
860
株式会社EventHub・エンジニア採用資料
eventhub
0
2.1k
知識と実践を紡ぐGenAI / Connecting Knowledge and experience with GenAI
aki_moon
2
180
動画配信サービスのフロントエンド実装に学ぶ設計原則
yud0uhu
1
140
Step by Stepで学ぶ、ADT(代数的データ型)、モナドからEffect-TSまで
leveragestech
1
3.2k
Money-saving tips for the frugal serverless developer
theburningmonk
1
400
Laboratories in Science and Technology: Deep Neural Networks
keio_smilab
PRO
3
170
Taking Flight with Tailwind CSS
opdavies
0
4.3k
Featured
See All Featured
VelocityConf: Rendering Performance Case Studies
addyosmani
321
23k
Practical Orchestrator
shlominoach
183
9.8k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
14
8.4k
Unsuck your backbone
ammeep
664
57k
Fantastic passwords and where to find them - at NoRuKo
philnash
39
2.5k
The Cost Of JavaScript in 2023
addyosmani
21
4k
5 minutes of I Can Smell Your CMS
philhawksworth
199
19k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
126
32k
Code Reviewing Like a Champion
maltzj
516
39k
GitHub's CSS Performance
jonrohan
1025
450k
YesSQL, Process and Tooling at Scale
rocio
165
13k
A better future with KSS
kneath
231
16k
Transcript
小規模個人アプリをRails 7.xにバー ジョンアップした話 Kazuhiro NISHIYAMA Kyoto.rb Meetup 2023-11-27 Powered by
Rabbit 3.0.3
self.introduction 西山 和広 Ruby のコミッター github など: @znz 株式会社Ruby開発 www.ruby-dev.jp
1/16
対象 個人メモ用アプリ https://github.com/znz/memo-app-r scaffold をちょっと改造した程度の機能のみ ログイン、検索 位置情報 (これが欲しかったので自作) (自分専用なので)メモ本文は生HTMLが書ける Dokku
にデプロイ 2/16
更新バージョン Rail 6.1.7.6 → 7.0.8 → 7.1.2 Ruby 3.1.4 →
3.2.2 3/16
更新方法 以下のように新規作成したアプリと比較 docker run --rm -it ruby:3.1.4 /bin/bash gem i
rails -v '~> 7.0.0' rails new /tmp/hoge --database=postgresql 4/16
新規と比較して更新 Gemfile config/environments/*.rb 5/16
bin/rails app:update bin/rails app:update で更新 Active Storage の migration などの不要なものは除外してマージ
6/16
decaffeinate テストを実行しようとすると *.coffee があるとエラーになった https://github.com/decaffeinate/decaffeinate https://decaffeinate-project.org/ を使って *.coffee を変換 7/16
turbolinks turbolinks も Gemfile から削除していたのでエラー turbo に書き換え app/assets/javascripts/application.js から //=
require turbolinks を削除 (turbo の追加は必要なかった) 8/16
警告対応 to_s(:delimited) → to_fs(:delimited) 9/16
assets:precompile 失敗 Dokku に deploy すると、なぜか rake assets:precompile でエ ラー
-----> Preparing app for Rails asset pipeline Running: rake assets:precompile rake aborted! LoadError: cannot load such file -- coffee_script 原因不明なので coffee-rails を Gemfile に戻した。 10/16
ruby も更新 ついでに ruby も 3.2.2 に更新 ruby file: ".ruby-version"
はデプロイでエラー ruby File.read(".ruby-version").chomp にした 11/16
new framework defaults config.load_defaults 7.0 に更新 new_framework_defaults_7_0.rb を削除 デプロイするとログアウトしていたのでログインしなおし 12/16
7.1 に更新 以下と比較して Gemfile を更新 docker run --rm -it ruby:3.2.2
/bin/bash gem i rails rails new /tmp/hoge --database=postgresql 13/16
app:update bin/rails app:update Active Storage の migration は除外してマージ 14/16
デプロイ テストも問題なく通るのでデプロイ 問題なく動いてそう Rails 7.0 から 7.1 は Rails のバージョンを上げるだけならあっ
さりできた 15/16
今後 new_framework_defaults_7_1 はまだ未対応なので対応予定 JavaScript の位置情報取得部分もテストしたい Rails 標準の minitest を試しているが、単純なテストのみなので rspec
と両方にしたい bootstrap 4 のままなので、更新か他のものに移行したい 位置情報取得部分を jQuery から移行したい coffee-rails は調査不足で原因不明のままだが sprockets を消 せば解決すると期待したい 16/16 Powered by Rabbit 3.0.3