# Problem with generating a scaffold with an Oracle DB

**URL:** <https://www.ruby-forum.com/t/problem-with-generating-a-scaffold-with-an-oracle-db/89245>\
**Category:** Rails\
**Created:** [March 28, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/problem-with-generating-a-scaffold-with-an-oracle-db/89245 "2006-03-28T17:50:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 28, 2006, 5:50pm UTC](https://www.ruby-forum.com/t/problem-with-generating-a-scaffold-with-an-oracle-db/89245/1 "2006-03-28T17:50:31Z")

</div>

Hi all,

I have confgured my oracle application with the Oracle Express  
Production release database. This all is configured well and tested(I  
can see that he founds the database). However, when I generate a  
scaffold application there is no view for the CRUD functions created for  
the application.  
Below is listed what is generated for me for a Products table:

E:\workdir\ruby\depot\>ruby script/generate scaffold Product Admin  
exists app/controllers/  
exists app/helpers/  
create app/views/admin  
exists test/functional/  
dependency model  
exists app/models/  
exists test/unit/  
exists test/fixtures/  
create app/models/product.rb  
create test/unit/product\_test.rb  
create test/fixtures/products.yml  
ORA-12537: TNS:connection closed

What is the problem here, because according to my tutorial in the fine  
book “Agile webdevelopment with Rails” it should create view components.

Does anyone see the problem here?

Thanks in advance!

-Tom

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 28, 2006, 10:43pm UTC](https://www.ruby-forum.com/t/problem-with-generating-a-scaffold-with-an-oracle-db/89245/2 "2006-03-28T22:43:22Z")

</div>

Hey Tom,

Looks like a problem connecting to Oracle. The ‘ORA-12537:  
TNS:connection closed’ is an Oracle error.

Have you tried just generating a model and starting the console to  
check connectivity?

try this:

ruby script/generate model Product

when done start up the console:

ruby script/console

> > p = Product.new  
> > p.save

See if you get an error message on the ‘p.save’ line. You may want  
to check that Oracle is allowing connections from remote hosts.

According to [ora-code.com](http://ora-code.com), ora-12537 is defined as:

ORA-12537: TNS:connection closed  
Cause: ‘End of file’ condition has been reached; partner has  
disconnected.  
Action: None needed; this is an information message.

Hope this helps.

-wilig

---

<div class="post-metadata">

**Author:** ![tharrisx](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/e19adc/32.png) [@tharrisx](https://www.ruby-forum.com/u/tharrisx)\
**Post date:** [March 29, 2006, 9:05am UTC](https://www.ruby-forum.com/t/problem-with-generating-a-scaffold-with-an-oracle-db/89245/3 "2006-03-29T09:05:22Z")

</div>

William G. wrote:

> Hey Tom,
> 
> Looks like a problem connecting to Oracle. The ‘ORA-12537:  
> TNS:connection closed’ is an Oracle error.
> 
> Have you tried just generating a model and starting the console to  
> check connectivity?
> 
> try this:
> 
> ruby script/generate model Product
> 
> when done start up the console:
> 
> ruby script/console
> 
> > > p = Product.new  
> > > p.save
> 
> See if you get an error message on the ‘p.save’ line. You may want  
> to check that Oracle is allowing connections from remote hosts.
> 
> According to [ora-code.com](http://ora-code.com), ora-12537 is defined as:
> 
> ORA-12537: TNS:connection closed  
> Cause: ‘End of file’ condition has been reached; partner has  
> disconnected.  
> Action: None needed; this is an information message.
> 
> Hope this helps.
> 
> -wilig

Hi Wilig,

I have already solved the problem. The settings in my database.yml where  
not the same as in the tnsnames.ora file of my DB installation.

The problem is now fixed and everythings works perfectly
