# Newbie Question about script/generate

**URL:** <https://www.ruby-forum.com/t/newbie-question-about-script-generate/165428>\
**Category:** Rails\
**Created:** [April 13, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/newbie-question-about-script-generate/165428 "2009-04-13T22:39:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![khagimoto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ee59a6/32.png) [@khagimoto](https://www.ruby-forum.com/u/khagimoto)\
**Post date:** [April 13, 2009, 10:39pm UTC](https://www.ruby-forum.com/t/newbie-question-about-script-generate/165428/1 "2009-04-13T22:39:58Z")

</div>

Hello,  
I just started learning RoR myself, and I have a few newbie questions.

(1) Is it always necessary to use the “script/generate” to start an  
app? Can it be created from scratch if one wanted to? (Not that I  
would, but I’m trying to understand…)

(2) I followed the rails getting started guide to create a blog  
successfully. Then I thought of adding a login/authentication  
mechanism, and proceeded to run the “script/generate login” (after  
getting login\_generator.zip) on the same rail app. It messed up the  
original blog, because it had file name conflicts (I think). How  
would I run multiple “script/generate” on an app without messing up  
the app?

Thanks!  
Kumi

---

<div class="post-metadata">

**Author:** ![khagimoto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ee59a6/32.png) [@khagimoto](https://www.ruby-forum.com/u/khagimoto)\
**Post date:** [April 14, 2009, 12:02pm UTC](https://www.ruby-forum.com/t/newbie-question-about-script-generate/165428/2 "2009-04-14T12:02:24Z")

</div>

1. It is definitely not necessary to use “script/generate” but it can  
be very helpful when you’re just starting out. The variants on  
generate (run “script/generate --help” and check out the installed  
generators) can give you a good idea on how the different MVC  
components hang together.

2. Yes, well there seems to be a growing dissatisfaction with plugins  
that rely on generate to build your app. My guess is that your  
experience is part of the reason. Configuration management (svn or  
git) can be invaluable here. You really want to be able to back out  
the recent damage on occasion.

As far as running multiple generates you need to understand what’s  
going on with the different generators, i.e.:

generate model User name:string profile:text  
generate scaffold User name:string profile:text

both create a user.rb model and migration but scaffold also builds the  
controller and views as well as adding routes.

You need to understand what is created when you issue the generate  
command and the best way I’ve found is to run it and study the  
results.

---

<div class="post-metadata">

**Author:** ![khagimoto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ee59a6/32.png) [@khagimoto](https://www.ruby-forum.com/u/khagimoto)\
**Post date:** [April 14, 2009, 5:24pm UTC](https://www.ruby-forum.com/t/newbie-question-about-script-generate/165428/3 "2009-04-14T17:24:59Z")

</div>

Thanks very much for this clarification. You’re right, I’m usually  
coding things myself and not used to the concept of having things  
generated for me. I do have git, so I was able to back out. It  
sounds like the best way for me is to learn what a lot of plugins do  
when generated, and combine those myself without using the generate.  
Just what you suggested… 🙂 Thanks!!

---

<div class="post-metadata">

**Author:** ![khagimoto](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/ee59a6/32.png) [@khagimoto](https://www.ruby-forum.com/u/khagimoto)\
**Post date:** [April 14, 2009, 7:34pm UTC](https://www.ruby-forum.com/t/newbie-question-about-script-generate/165428/4 "2009-04-14T19:34:47Z")

</div>

Glad I could help.
