# Cannot generate a model?

**URL:** <https://www.ruby-forum.com/t/cannot-generate-a-model/112581>\
**Category:** Rails\
**Created:** [August 21, 2007, 4:16am UTC](https://www.ruby-forum.com/t/cannot-generate-a-model/112581 "2007-08-21T04:16:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![krystianf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/46a35a/32.png) [@krystianf](https://www.ruby-forum.com/u/krystianf)\
**Post date:** [August 21, 2007, 4:16am UTC](https://www.ruby-forum.com/t/cannot-generate-a-model/112581/1 "2007-08-21T04:16:58Z")

</div>

So I have installed Instant Rails on my computer, and I’ve been  
following some RoR tutorials from [lynda.com](http://lynda.com). I created a new app  
called music\_library, and then when trying to create a model, I get  
something weird,

typing in: rails script/generate model Album

I receive:

exists  
create app/controllers  
File exists - script/generate

(by the way this is in dos command prompt)

NOW, I’ve generated a model before, and I THINK i ran rails script or  
rails script/generate in my rails\_apps directory. Then I noticed that  
i had to be in my actual application directory (music\_library) in this  
case, and when i tried to generate a model I get only these three  
lines, as opposed to a lot more before. Same thing happens when I try  
to generate a controller. And my application does not do what it’s  
supposed to do in the tutorial (basically throws me an error)

any help?

thanks

---

<div class="post-metadata">

**Author:** ![krystianf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/46a35a/32.png) [@krystianf](https://www.ruby-forum.com/u/krystianf)\
**Post date:** [August 21, 2007, 4:23am UTC](https://www.ruby-forum.com/t/cannot-generate-a-model/112581/2 "2007-08-21T04:23:58Z")

</div>

Hi yer,

You need to replace rails script/generate… with ruby script/  
generate…

cheers, Dave

---

<div class="post-metadata">

**Author:** ![krystianf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/46a35a/32.png) [@krystianf](https://www.ruby-forum.com/u/krystianf)\
**Post date:** [August 21, 2007, 10:02pm UTC](https://www.ruby-forum.com/t/cannot-generate-a-model/112581/3 "2007-08-21T22:02:48Z")

</div>

Hey Dave,

That doesn’t work. Keep in mind that i am running this on a windows  
machine in dos prompt. Ruby seems like a command that doesn’t exist

Typing: ruby script/generate model Albums returns this: ruby: No  
such file or directory – script/generate (LoadError)

---

<div class="post-metadata">

**Author:** ![krystianf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/46a35a/32.png) [@krystianf](https://www.ruby-forum.com/u/krystianf)\
**Post date:** [September 25, 2007, 11:00pm UTC](https://www.ruby-forum.com/t/cannot-generate-a-model/112581/4 "2007-09-25T23:00:00Z")

</div>

Actually, not for Instant rails.  
On the instant rails window, click the black “I”. Bring up Rails  
Applications|Manage Rails Applications… In this window, click on  
“Create New Rails App”. This brings up a command prompt in the  
Instant Rails environment. In particular, the ruby which comes with  
Instant Rails is in the path. “ruby script/generate model Albums”  
should now work just fine. If you are already set up in subversion, -  
c will add the new files.

Nathan

---

<div class="post-metadata">

**Author:** ![krystianf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/46a35a/32.png) [@krystianf](https://www.ruby-forum.com/u/krystianf)\
**Post date:** [September 25, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/cannot-generate-a-model/112581/5 "2007-09-25T23:04:50Z")

</div>

It will work, you just need to supply the full path to ruby i.e.

C:/path/to/ruby script/generate model Albums

krystianf wrote:

> > Hi yer,
> > 
> > > following some RoR tutorials from [lynda.com](http://lynda.com). I created a new app
> > > 
> > > any help?
> > > 
> > > thanks
> 
> >

–  
Sincerely,

William P.
