# Generate scaffold failing

**URL:** <https://www.ruby-forum.com/t/generate-scaffold-failing/97348>\
**Category:** Rails\
**Created:** [July 6, 2006, 2:47pm UTC](https://www.ruby-forum.com/t/generate-scaffold-failing/97348 "2006-07-06T14:47:23Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [July 6, 2006, 2:47pm UTC](https://www.ruby-forum.com/t/generate-scaffold-failing/97348/1 "2006-07-06T14:47:23Z")

</div>

Hi all,

Got a Win2k3 Server box (but this has been verified not to work also on  
WinXP Pro SP2) with:  
Ruby 1.8.2  
Rails 1.1.4  
PostgreSQL 8.1

The generate\scaffold script fails to generate the files inside the  
app/model/views directories. It actually generates the view directory  
but fails to produce any files.

The same thing works perfectly when I’m targetting MySQL.

So is this normal behaviour with postgres-pr (the standard driver that  
ships with Rails) or can i fix it someway?

Thanks,  
Lorenzo

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [July 6, 2006, 8:08pm UTC](https://www.ruby-forum.com/t/generate-scaffold-failing/97348/2 "2006-07-06T20:08:03Z")

</div>

> The generate\scaffold script fails to generate the files inside the  
> app/model/views directories. It actually generates the view directory  
> but fails to produce any files.
> 
> The same thing works perfectly when I’m targetting MySQL.

I had the same symptoms when rails could not connect to the database.  
Check the config/database.yml and make sure that you can connect using  
that login (check for development vs. testing vs. production as well)

I wanted to change the port that MySQL uses, so without documentation, I  
just added :port =\> 1234, and it worked! Low-surprise rocks.

Cheers

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [July 6, 2006, 10:25pm UTC](https://www.ruby-forum.com/t/generate-scaffold-failing/97348/3 "2006-07-06T22:25:08Z")

</div>

Richard Haven wrote:

> > The generate\scaffold script fails to generate the files inside the  
> > app/model/views directories. It actually generates the view directory  
> > but fails to produce any files.
> > 
> > The same thing works perfectly when I’m targetting MySQL.
> 
> I had the same symptoms when rails could not connect to the database.  
> Check the config/database.yml and make sure that you can connect using  
> that login (check for development vs. testing vs. production as well)
> 
> I wanted to change the port that MySQL uses, so without documentation, I  
> just added :port =\> 1234, and it worked! Low-surprise rocks.
> 
> Cheers

If your database does exist, make sure that the tables exist in there as  
well. I’ve been bitten by that bug many a late night when I began  
ramping up on rails.

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [July 7, 2006, 7:27am UTC](https://www.ruby-forum.com/t/generate-scaffold-failing/97348/4 "2006-07-07T07:27:36Z")

</div>

So new to Rails so I apologize if I’m way off…

Is ‘scaffold’ supposed to create something in /views?

I’m trying to work thru the tutorial and I can’t seem to get it to work.  
My error msg is “Errno::ENOENT in RecipeController#new”.

Is this the same problem?

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [July 7, 2006, 6:50am UTC](https://www.ruby-forum.com/t/generate-scaffold-failing/97348/5 "2006-07-07T06:50:38Z")

</div>

If your using postgres, try using the command:

rails myapp --database=postgres

This will generate a database.yml that is specific for your database.

Good luck!

Bing

---

<div class="post-metadata">

**Author:** ![lbolognini](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/ba8739/32.png) [@lbolognini](https://www.ruby-forum.com/u/lbolognini)\
**Post date:** [July 7, 2006, 9:50am UTC](https://www.ruby-forum.com/t/generate-scaffold-failing/97348/6 "2006-07-07T09:50:48Z")

</div>

Richard Haven wrote:

> > The generate\scaffold script fails to generate the files inside the  
> > app/model/views directories. It actually generates the view directory  
> > but fails to produce any files.
> > 
> > The same thing works perfectly when I’m targetting MySQL.
> 
> I had the same symptoms when rails could not connect to the database.  
> Check the config/database.yml and make sure that you can connect using  
> that login (check for development vs. testing vs. production as well)
> 
> I wanted to change the port that MySQL uses, so without documentation, I  
> just added :port =\> 1234, and it worked! Low-surprise rocks.
> 
> Cheers

Hi Richard,

my PG is running on the standard port and i can connect to it just fine  
with my user/password. The name of the database i’m targetting is ok.  
I’ve once been bitten by a kinda same bug because i was wanting to  
scaffold a “users” table which is a reserved keyword for PG… but this  
is not the case as I’m verifying it also with a “foos” table.

Thanks for helping anyway… gotta investigate this further!

Lorenzo
