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 new"の世界 / The World of "rai...
Search
luccafort
PRO
September 05, 2025
Programming
1
1.3k
知っているようで知らない"rails new"の世界 / The World of "rails new" You Think You Know but Don't
September 6th, 2025. ながらRuby会議01の登壇資料です。
luccafort
PRO
September 05, 2025
Tweet
Share
More Decks by luccafort
See All by luccafort
小さく始めて、大きく育てる「情報発信」 〜中長期的な組織戦略と組織開発を通して学んだエッセンス〜/ Start Small, Grow Big: Information Dissemination
luccafort
PRO
1
95
君は新しい日付/時刻API Temporal を知っているか?
luccafort
PRO
5
2.4k
社内イベントを通してNext Actionを生み出し、エンゲージメントを高める施策の作り方
luccafort
PRO
0
630
Re:boot of one of Ruby Community.
luccafort
PRO
0
1k
Why Money Forward contributes to Ruby and RubyKaigi?
luccafort
PRO
0
2.9k
なぜRubyコミュニティにコミットするのか?
luccafort
PRO
0
1.1k
Motto Go Forward Goを支える文化とコミュニティ 〜なぜ我々はコミュニティにコントリ ビュートするのか〜
luccafort
PRO
0
1.8k
Go Generics 超入門 / Kyoto.go Remote #28 LT会 (2022/02/23)
luccafort
PRO
3
1.6k
テックブログをフォワードする技術 ~よくある質問編~
luccafort
PRO
0
500
Other Decks in Programming
See All in Programming
組込みだけじゃない!TinyGo で始める無料クラウド開発入門
otakakot
2
380
AIと人間の共創開発!OSSで試行錯誤した開発スタイル
mae616
2
810
登壇は dynamic! な営みである / speech is dynamic
da1chi
0
360
CSC509 Lecture 06
javiergs
PRO
0
270
iOSでSVG画像を扱う
kishikawakatsumi
0
170
なぜGoのジェネリクスはこの形なのか? - Featherweight Goが明かす設計の核心
qualiarts
0
260
CSC509 Lecture 08
javiergs
PRO
0
250
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
490
Writing Better Go: Lessons from 10 Code Reviews
konradreiche
3
6.8k
AI 駆動開発におけるコミュニティと AWS CDK の価値
konokenj
5
250
EMこそClaude Codeでコード調査しよう
shibayu36
0
430
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
290
Featured
See All Featured
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
1.7k
Optimizing for Happiness
mojombo
379
70k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
253
22k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
37
2.6k
Practical Orchestrator
shlominoach
190
11k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
132
19k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
What's in a price? How to price your products and services
michaelherold
246
12k
Building Applications with DynamoDB
mza
96
6.7k
Code Reviewing Like a Champion
maltzj
526
40k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Transcript
ͬͯΔΑ͏ͰΒͳ͍ rails newͷੈք ϚωʔϑΥϫʔυ ژ։ൃڌ @luccafort 1
ओཁͳSNS Twitter: @luccafort GitHub: @luccafort Mixi2: @luccafort ࣗݾհ idɿ@luccafort •
Kyoto.rb / ؔRubyձٞ08 / Go Conference 2025 ΦʔΨφΠβʔ • Kyoto.go ϑΝϯμʔ • ϚωʔϑΥϫʔυ ژ։ൃڌॴଐ • 20256݄͔ΒϓϩδΣΫτϚωʔδϟʔʹ ͳΓ·ͨ͠ 2
None
None
None
None
None
None
9
10
None
None
None
None
None
None
None
༏लਓࡐٻΉʂʂʂ 28ଔֶੜͩͱͳ͓Ϥγοʂ ϚωʔϑΥϫʔυͷ ։ൃऀΞΧϯτ ͪ͜Β ↓↓↓ ࠓ11݄͔Βฐࣾʢin Tokyoʣʹ৽ଔೖࣾ͢Δ Denys͘Μ
໊ݹڌͷ Πϯλʔϯืू ͪ͜Β͔Βʂ ↓↓↓↓↓
None
“rails new”ΛֶͿతͱഎܠ “rails new”ͷ࣮ΛಡΈղ͘ “rails new”͔ΒಘΒΕΔ͜ͱ Agenda 21
ಥવͰ͕͢…… 22
“rails new”͕Ͳ͏ಈ͔͘ આ໌Ͱ͖Δਓ 🙋🙋 23
͍·खΛ͋͛ΒΕͳ͔ͬͨਓ…… 24
ʮ͋ͳͨʯ͕ରऀͰ͢ɻ 🎉🎉🎉🎉🎉 25
త ͳͥ”rails new”ʹ͍ͭͯͦ͏ͱࢥͬͨͷ͔ʁ 26
త ͳͥ”rails new”ʹ͍ͭͯͦ͏ͱࢥͬͨͷ͔ʁ 27 • RailsΛΑΓਂ͘ཧղ͔ͨͬͨ͠ • ݸਓ։ൃʮҎ֎ʯͷͷબࢶͬͯͳΜ͚ͩͬʁ • ؔRubyձٞ08ɺΑ͔ͬͨΑͶ……
• Ͱݸਓ։ൃͷѹ͕ڧ͗ͨ͢ؾ͢Δ • ݸਓ։ൃͰͳ͍ͷબࢶ͋ΔΜ͡Όͳ͍͔ʁ
• RailsΛΑΓਂ͘ཧղ͔ͨͬͨ͠ • ݸਓ։ൃʮҎ֎ʯͷͷબࢶͬͯͳΜ͚ͩͬʁ • ؔRubyձٞ08ɺΑ͔ͬͨΑͶ…… • Ͱݸਓ։ൃͷѹ͕ڧ͗ͨ͢ؾ͢Δ • ݸਓ։ൃͰͳ͍ͷબࢶ͋ΔΜ͡Όͳ͍͔ʁ
త ͳͥ”rails new”ʹ͍ͭͯͦ͏ͱࢥͬͨͷ͔ʁ 28 ͳʹΑΓίʔυΛಡΜͩΓɺ ॻ͍ͨΓ͢Δͷָ͍͠ʂʂ
ํੑܾ·͚ͬͨͲ ͡Ό࣮͋ࡍͳʹΛ͢Δͱ͍͍ΜͩΖ͏ʁ 🤔
࣮ࡍʹRailsΛಈ͔ͯ͠ Irb.pryͰͳʹΛͯ͠Δ͔ ݟΕ͍͍͡ΌΜ 30
࣮ࡍʹRailsΛಈ͔ͯ͠ Irb.pryͰͳʹΛͯ͠Δ͔ ݟΕ͍͍͡ΌΜ ͳΔ΄Ͳʁʁʁ 31
None
33 ͦ͏͍͑”rails new”͕ ͳʹͬͯΔ͔આ໌Ͱ͖ͳ͘Ͷʁ
• ͳΜ͔Generatorͱ͔ͬͯͦ͏ɻ • CommandΫϥεΛ࣮ͬͯ͞Εͦ͏ • ੲௐͨؾ͕͢Δ͚ͲΕͨ…… 34
“rails new”ΛֶͿతͱഎܠ “rails new”ͷ࣮ΛಡΈղ͘ “rails new”ΛಡΉͱݟ͑ͯ͘ΔʮRailsΒ͠͞ʯ Agenda 35
“rails new”ͷ ࣮ΛಡΈղ͘ 36
1. ίϚϯυղੳ: CLI → Command → ApplicationCommand 2. δΣωϨʔλॳظԽ: AppGenerator.new
3. Φϓγϣϯॲཧ: implied_optionsઃఆ 4. σΟϨΫτϦ࡞: create_root → mkdir 5. ϑΝΠϧੜ: ςϯϓϨʔτ͔ΒϑΝΠϧ࡞ 6. Bundle Install: bundle install࣮ߦ 7. ڥઃఆ: JS/CSS/Hotwireɺafter_bundle_callbacksͷ࣮ߦ 37 Rails new ࣮ߦॱ ͬ͘͟Γ·ͱΊ
3. Φϓγϣϯॲཧ: implied_optionsઃఆ 4. σΟϨΫτϦ࡞: create_root 5. ϑΝΠϧੜ: ςϯϓϨʔτ͔ΒϑΝΠϧ࡞ 6.
Bundle 7. ڥઃఆ: JS/CSS/Hotwireɺafter_bundle_callbacksͷ࣮ߦ 38 Rails new ࣮ߦॱ ͬ͘͟Γ·ͱΊ 1. ίϚϯυղੳ: CLI → Command → ApplicationCommand 2. δΣωϨʔλॳظԽ: AppGenerator.new Rails new ࣮ߦॱ ͬ͘͟Γ·ͱΊ 38 ͕͜͜Θ͔Ε આ໌Ͱ͖ͦ͏ʂ
CLIͲͷΑ͏ʹͯ͠ݺΕ͍ͯΔ͔ 39
“rails/cli”ͰͳʹΛ͍ͯ͠Δ͔ʁ 40
“rails/cli”ͰͳʹΛ͍ͯ͠Δ͔ʁ 41
“rails/command”ͰͳʹΛ͍ͯ͠Δ͔ʁ 42
“rails/command”ͰͳʹΛ͍ͯ͠Δ͔ʁ 43
“rails/command”ͰͳʹΛ͍ͯ͠Δ͔ʁ 44
“rails/command”ͰͳʹΛ͍ͯ͠Δ͔ʁ 45
“rails/command”ͰͳʹΛ͍ͯ͠Δ͔ʁ 46
“rails/command”ͰͳʹΛ͍ͯ͠Δ͔ʁ 47
“rails/command”ͰͳʹΛ͍ͯ͠Δ͔ʁ 48
“ApplicationCommand::Base”Ͱ ͳʹΛ͍ͯ͠Δ͔ʁ 49
“Rails::Generators::AppGenerator”Ͱ ͳʹΛ͍ͯ͠Δ͔ʁ 50
“Rails::Generators::AppGenerator”Ͱ ͳʹΛ͍ͯ͠Δ͔ʁ 51
“Rails::Generators::AppGenerator”Ͱ ͳʹΛ͍ͯ͠Δ͔ʁ 52
“Rails::Generators::AppGenerator”Ͱ ͳʹΛ͍ͯ͠Δ͔ʁ 53
“Rails::Generators::AppGenerator”Ͱ ͳʹΛ͍ͯ͠Δ͔ʁ 54
ίʔϧόοΫ࣮ߦͰͳʹΛ͍ͯ͠Δ͔ʁ 55
͔ͬͨʂʁʂʁʂʂʂʂ 56
“rails new”ΛֶͿతͱഎܠ “rails new”ͷ࣮ΛಡΈղ͘ “rails new”͔ΒಘΒΕΔ͜ͱ Agenda 57
“rails new”͔ΒಘΒΕΔ͜ͱ 58
59
60
• ΈΛཧղ͍ͯ͠ͳͯ͘Railsʮʯ͑Δ • ਂ͘ཧղ͢Δʹʮؔ࿈ࣝɾഎܠɾԾઆɾݕূʯ͕ େࣄ ΈΛཧղ͢ΔͱԿ͕خ͍͔͠ 61
• ਓʮͰ͖ͦ͏ʯͳ͜ͱ͔͠ʮΓ͍ͨʯͱࢥΘͳ͍ • ۙͳಓ۩ʹର͢ΔཧղΛਂΊΔͱൃͷ͖͔͚͕ͬ ੜ·ΕΔ ΈΛཧղ͢ΔͱԿ͕خ͍͔͠ 62
https://www.nlp.co.jp/000015.php 63
͍ͬͯΔͱʮͰ͖Δʯ͜ͱ ͷ෯͕͕Δʂ
https://github.com/onk/rails_app_template/blob/master/ costtie_template.rb ͜ͷtemplateϑΝΠϧΛ͏ͱ ͍ͭ͏δΣϜઃఆ͕શ෦ ೖͬͨঢ়ଶͰ։ൃ͕ελʔτͰ͖ ΔͷͰศར
ΈΛཧղ͢ΔͱԿ͕خ͍͔͠
ΈΛཧղ͢ΔͱԿ͕خ͍͔͠
• Railsͷίʔυҙ֎ͱಡΊΔ •ʮΘ͔Βͳ͍ʯ߹ʮΘ͔Δʯঢ়ଶ·ͰϨϕϧΛ۷Γ Լ͛Α͏ɻʮΘ͔ͬͨʯΒྡྖҬʹखΛ͛Α͏ •ʮΑ͍͍ʯ͕Ͱ͖ΔؒίϛϡχςΟΛݟ͚ͭΑ͏ 68 ·ͱΊ
$ rails new \ welcome:rails_world! 69
ͬͯΈͯ ବͩͬͨΒ ਓʹฉ͚ ຊͷҰ۟
None
72
References • https://github.com/rails/rails/ • Rails Τϯδϯೖ • https://railsguides.jp/engines.html • Rails
newͷॲཧΛͬͯΈͨ • https://qiita.com/okuramasafumi/items/707a74af435f321c1fc2 • ਪ͠׆ͱͯ͠ͷrails new • https://kaigionrails.org/2024/talks/sakahukamaki/ • rails new ͨ࣌͠ͷՃॲཧΛ͔͘ • https://blog.eiel.info/blog/2013/08/01/rails-new-template/
References • Rails6ʹ͓͍ͯɺrails newͨ͋͠ͱʹඪ४ػೳΛؒҾ͍ ͍ͯ͘ͱ͖ʹΈΔ͖ͱ͜Ζ • https://shinkufencer.hateblo.jp/entry/2020/11/14/000000 • ActiveSupport::CodeGenerator Ͱ༡΅͏
• https://developers.freee.co.jp/entry/activesupport-generator • GemɺRailtieϓϥάΠϯɺEngineʢfull/mountableʣͷҧ ͍ͱͦΕͧΕͷجૅใ • https://qiita.com/kidach1/items/565c2c077ae8d15fe3a8
References • ͍͍࣭ͬͯͳΜͩΖ͏ • https://note.com/shuharinoshu/n/n6558b8f4adc2 • ϫʔΫγϣοϓʹ͓͚Δ”ྑ͍͍"ͱʁ • https://note.com/yuki_anzai/n/nba5741aa630f