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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
Kazuhiro NISHIYAMA
November 27, 2023
Technology
130
0
Share
小規模個人アプリをRails 7.xにバージョンアップした話
[【出張版】Kyoto.rb Meetup 【大阪だよ】](
https://kyotorb.connpass.com/event/296972/)のLT大会での発表資料です
。
Kazuhiro NISHIYAMA
November 27, 2023
More Decks by Kazuhiro NISHIYAMA
See All by Kazuhiro NISHIYAMA
Headscale + Tailscale に移行中
znz
0
41
Ruby on Rails と私
znz
0
60
riscv64.rubyci.org internal
znz
0
51
Rubyの日本語リファレンスマニュアルの現在と未来
znz
0
99
devise-two-factorを4.xから5.xに上げた話
znz
0
400
docs.ruby-lang.org/ja/ の生成方法を変えた
znz
0
110
Ubuntuのriscv64版をqemuで動かした
znz
0
130
lilo.linux.or.jpをbusterからbullseyeに上げた
znz
0
130
Ruby リファレンスマニュアル改善計画 2022 進捗報告
znz
0
190
Other Decks in Technology
See All in Technology
DevOpsDays Tokyo 2026 軽量な仕様書と新たなDORA AI ケイパビリティで実現する、動くソフトウェアを中心とした開発ライフサイクル / DevOpsDays Tokyo 2026
n11sh1
0
130
サイボウズ 開発本部採用ピッチ / Cybozu Engineer Recruit
cybozuinsideout
PRO
10
78k
明日からドヤれる!超マニアックなAWSセキュリティTips10連発 / 10 Ultra-Niche AWS Security Tips
yuj1osm
0
450
インターネットの技術 / Internet technology
ks91
PRO
0
110
CDK Insightsで見る、AIによるCDKコード静的解析(+AI解析)
k_adachi_01
2
160
サイバーフィジカル社会とは何か / What Is a Cyber-Physical Society?
ks91
PRO
0
190
Introduction to Sansan, inc / Sansan Global Development Center, Inc.
sansan33
PRO
0
3k
Databricksで構築するログ検索基盤とアーキテクチャ設計
cscengineer
0
190
🀄️ on swiftc
giginet
PRO
0
360
暗黙知について一歩踏み込んで考える - 暗黙知の4タイプと暗黙考・暗黙動へ
masayamoriofficial
0
1.7k
OBI+APMでお手軽にアプリケーションのオブザーバビリティを手に入れよう
kenshimuto
0
310
"SQLは書けません"から始まる データドリブン
kubell_hr
2
430
Featured
See All Featured
The Spectacular Lies of Maps
axbom
PRO
1
690
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
53k
The SEO Collaboration Effect
kristinabergwall1
0
420
The Limits of Empathy - UXLibs8
cassininazir
1
290
エンジニアに許された特別な時間の終わり
watany
106
240k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
320
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
DevOps and Value Stream Thinking: Enabling flow, efficiency and business value
helenjbeal
1
160
First, design no harm
axbom
PRO
2
1.2k
The Organizational Zoo: Understanding Human Behavior Agility Through Metaphoric Constructive Conversations (based on the works of Arthur Shelley, Ph.D)
kimpetersen
PRO
0
310
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