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.1k
知っているようで知らない"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
94
君は新しい日付/時刻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
『毎日の移動』を支えるGoバックエンド内製開発
yutautsugi
2
180
CSC305 Lecture 04
javiergs
PRO
0
250
ポスターセッション: 「まっすぐ行って、右!」って言ってラズパイカーを動かしたい 〜生成AI × Raspberry Pi Pico × Gradioの試作メモ〜
komofr
0
940
Playwrightはどのようにクロスブラウザをサポートしているのか
yotahada3
7
2.3k
止められない医療アプリ、そっと Swift 6 へ
medley
1
120
CSC305 Lecture 03
javiergs
PRO
0
230
CSC509 Lecture 03
javiergs
PRO
0
330
Pythonスレッドとは結局何なのか? CPython実装から見るNoGIL時代の変化
curekoshimizu
4
1.3k
AIエージェント時代における TypeScriptスキーマ駆動開発の新たな役割
bicstone
4
1.5k
iOSアプリの信頼性を向上させる取り組み/ios-app-improve-reliability
shino8rayu9
0
150
iOSエンジニア向けの英語学習アプリを作る!
yukawashouhei
0
180
(Extension DC 2025) Actor境界を越える技術
teamhimeh
1
220
Featured
See All Featured
Testing 201, or: Great Expectations
jmmastey
45
7.7k
Rebuilding a faster, lazier Slack
samanthasiow
84
9.2k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
BBQ
matthewcrist
89
9.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
127
53k
VelocityConf: Rendering Performance Case Studies
addyosmani
332
24k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
46
7.6k
How to train your dragon (web standard)
notwaldorf
96
6.3k
Fireside Chat
paigeccino
40
3.7k
Six Lessons from altMBA
skipperchong
28
4k
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