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
81
知っているようで知らない"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
91
君は新しい日付/時刻API Temporal を知っているか?
luccafort
PRO
5
2.4k
社内イベントを通してNext Actionを生み出し、エンゲージメントを高める施策の作り方
luccafort
PRO
0
620
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
490
Other Decks in Programming
See All in Programming
コンテキストエンジニアリング Cursor編
kinopeee
1
760
時間軸から考えるTerraformを使う理由と留意点
fufuhu
14
4.3k
Flutter with Dart MCP: All You Need - 박제창 2025 I/O Extended Busan
itsmedreamwalker
0
130
詳解!defer panic recover のしくみ / Understanding defer, panic, and recover
convto
0
220
CSC305 Summer Lecture 12
javiergs
PRO
0
130
Zendeskのチケットを Amazon Bedrockで 解析した
ryokosuge
3
270
複雑なドメインに挑む.pdf
yukisakai1225
5
980
私の後悔をAWS DMSで解決した話
hiramax
4
190
tool ディレクティブを導入してみた感想
sgash708
1
160
レガシープロジェクトで最大限AIの恩恵を受けられるようClaude Codeを利用する
tk1351
4
1.6k
print("Hello, World")
eddie
1
490
Updates on MLS on Ruby (and maybe more)
sylph01
1
180
Featured
See All Featured
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
The Invisible Side of Design
smashingmag
301
51k
How STYLIGHT went responsive
nonsquared
100
5.8k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.1k
Music & Morning Musume
bryan
46
6.8k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
111
20k
Stop Working from a Prison Cell
hatefulcrawdad
271
21k
RailsConf 2023
tenderlove
30
1.2k
Designing Dashboards & Data Visualisations in Web Apps
destraynor
231
53k
Building Applications with DynamoDB
mza
96
6.6k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
131
19k
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