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
100
知っているようで知らない"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
92
君は新しい日付/時刻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
OSS開発者という働き方
andpad
5
1.7k
MCPでVibe Working。そして、結局はContext Eng(略)/ Working with Vibe on MCP And Context Eng
rkaga
5
2.2k
アセットのコンパイルについて
ojun9
0
110
TanStack DB ~状態管理の新しい考え方~
bmthd
2
490
Testing Trophyは叫ばない
toms74209200
0
800
Rancher と Terraform
fufuhu
2
240
Kiroで始めるAI-DLC
kaonash
2
570
Honoアップデート 2025年夏
yusukebe
1
920
時間軸から考えるTerraformを使う理由と留意点
fufuhu
14
4.6k
Processing Gem ベースの、2D レトロゲームエンジンの開発
tokujiros
2
120
Azure SRE Agentで運用は楽になるのか?
kkamegawa
0
1.8k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
280
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
229
22k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
139
34k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.6k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
30
9.6k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
Designing for humans not robots
tammielis
253
25k
A Modern Web Designer's Workflow
chriscoyier
696
190k
Balancing Empowerment & Direction
lara
3
610
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
It's Worth the Effort
3n
187
28k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
31
2.2k
How GitHub (no longer) Works
holman
315
140k
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