# FastCgi/OCI8 problem

**URL:** <https://www.ruby-forum.com/t/fastcgi-oci8-problem/52155>\
**Category:** Rails\
**Created:** [January 11, 2006, 3:38pm UTC](https://www.ruby-forum.com/t/fastcgi-oci8-problem/52155 "2006-01-11T15:38:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Maria\_Gutierrez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@Maria\_Gutierrez](https://www.ruby-forum.com/u/Maria_Gutierrez)\
**Post date:** [January 11, 2006, 3:38pm UTC](https://www.ruby-forum.com/t/fastcgi-oci8-problem/52155/1 "2006-01-11T15:38:57Z")

</div>

Hi,

I’m having problems running my rails application in the following  
setup Unix/Apache/FastCgi/Oracle10g.

I had my app running quite happy until I installed the OCI8 driver.  
When I try to load the app I get in the apache logs the famous

“undefined method ‘define\_a\_column’ for class OCI8:Cursor (NameError)”

I think the problem is with the fastcgi set up since I’ve been able to  
test the connection by running ruby scripts from the shell command and  
my app runs quite happy in WebBrick.

I’ve added all the suggested environment variables to my httpd.conf  
(ORACLE\_HOME, LD\_LIBRARY\_PATH, ORACLE\_SID). They are all se up  
correctly since I can print them out in environment.rb.

 FastCgiIpcDir /tmp/fcgi\_ipc FastCgiServer /usr/local//public/dispatch.fcgi \ -initial-env RAILS\_ENV=stage \ -initial-env ORACLE\_HOME=/oracle/product/10.2.0/client \ -initial-env ORACLE\_SID= \ -initial-env LD\_LIBRARY\_PATH=/oracle/product/10.2.0/client/lib \ -processes 10 -idle-timeout 60

I’ve also tried setting this variables in the VirtualHost for my app  
with no luck.

Plese any ideas of any variable missing or any obvious mistake. I’ve  
already spend quite a lot of time trying to sort this out with no  
success.

Thanks for your help.

Maria

---

<div class="post-metadata">

**Author:** ![Maria\_Gutierrez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@Maria\_Gutierrez](https://www.ruby-forum.com/u/Maria_Gutierrez)\
**Post date:** [January 11, 2006, 3:48pm UTC](https://www.ruby-forum.com/t/fastcgi-oci8-problem/52155/2 "2006-01-11T15:48:22Z")

</div>

Salut Maria,

> ```
> -initial-env RAILS_ENV=stage \
> 
> ```

Are you sure of this ? usually ['development, production, test]

Try adding :

-initial-env RUBYOPT=rubygems   
-initial-env PATH=

---

<div class="post-metadata">

**Author:** ![Maria\_Gutierrez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@Maria\_Gutierrez](https://www.ruby-forum.com/u/Maria_Gutierrez)\
**Post date:** [January 11, 2006, 4:02pm UTC](https://www.ruby-forum.com/t/fastcgi-oci8-problem/52155/3 "2006-01-11T16:02:25Z")

</div>

Mathieu,

I’ve tried this but I’m still getting the same problem. Any other ideas?

I use a self-created stage environment to test my application in a  
unix/apache set up before the app goes live, since the development of  
the app is done in Windows/WebBrick. I could use development as well but  
the databases are different so rather keep it separate.

Maria

Mathieu C. wrote:

> Salut Maria,
> 
> > ```
> > -initial-env RAILS_ENV=stage \
> > 
> > ```
> 
> Are you sure of this ? usually ['development, production, test]
> 
> Try adding :
> 
> -initial-env RUBYOPT=rubygems   
> -initial-env PATH=

---

<div class="post-metadata">

**Author:** ![Maria\_Gutierrez](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/57b2e6/32.png) [@Maria\_Gutierrez](https://www.ruby-forum.com/u/Maria_Gutierrez)\
**Post date:** [January 11, 2006, 4:52pm UTC](https://www.ruby-forum.com/t/fastcgi-oci8-problem/52155/4 "2006-01-11T16:52:29Z")

</div>

> I’ve tried this but I’m still getting the same problem. Any other ideas?

It’s looks like the oci8.rb is not read/found by the AR Adapter.

I’m for a load path issue here…

Check \<%= debug ENV %\> in your differents environments for tracking  
down most noticeable differences.
