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
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
CSC305 Lecture 01
javiergs
PRO
1
380
プログラミングどうやる? ~テスト駆動開発から学ぶ達人の型~
a_okui
0
190
Back to the Future: Let me tell you about the ACP protocol
terhechte
0
120
株式会社 Sun terras カンパニーデック
sunterras
0
180
パフォーマンスチューニングで Web 技術を深掘り直す
progfay
18
4.8k
アメ車でサンノゼを走ってきたよ!
s_shimotori
0
120
議事録の要点整理を自動化! サーバレス Bot 構築術
penpeen
3
1.6k
Model Pollution
hschwentner
1
180
CSC305 Lecture 02
javiergs
PRO
1
260
気づいて!アプリからのSOS 〜App Store Connect APIで始めるパフォーマンス健康診断〜
waka12
0
260
Pull-Requestの内容を1クリックで動作確認可能にするワークフロー
natmark
1
420
ソフトウェア設計の実践的な考え方
masuda220
PRO
3
300
Featured
See All Featured
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
140
34k
The Power of CSS Pseudo Elements
geoffreycrofte
79
6k
Done Done
chrislema
185
16k
KATA
mclloyd
32
14k
Unsuck your backbone
ammeep
671
58k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
358
30k
Facilitating Awesome Meetings
lara
56
6.6k
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.1k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Practical Orchestrator
shlominoach
190
11k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
2.6k
Into the Great Unknown - MozCon
thekraken
40
2.1k
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