From: Cetric Blue Date: 2008-10-29T06:36:06+09:00 Subject: Re: oracle_enhanced adapter 'uninitialized constant' error Cetric Blue wrote: > Todd Benson wrote: >> On Tue, Oct 28, 2008 at 2:36 PM, Todd Benson >> wrote: >>> On Tue, Oct 28, 2008 at 2:02 PM, Cetric Blue wrote: >>>> Todd, >>>> Yes, the database is definitely running, although it is through the >>>> network, but I have the port specified in ":host => "abc.def.jkl:1521". >>>> >>>> I moved require 'rubygems' to the top of the code, same error remains... >>> >>> Cetric, >>> Have you tried :port => 1521 as part of the hash? >> >> I think that might have to be :port => "1521" (in quotes). Untested, >> BTW. >> >> Todd > > Todd, > > Thanks for all your help, it turns out to be I didn't setup > LD_LIBRARY_PATH correctly for all users. Although now I fixed the path, > but it gave me a new error: > > /usr/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/commands/runner.rb:45: > env.c:257:in > oci8lib.so: ORA-12154: TNS:could not resolve the connect identifier > specified (O > CIError) > > But that's totally something else. I'll do some further investigation on > that. > > Thanks! Just in case any one who's interested, for the TNS error I had above, it was because I didn't set the path for HOME_ORACLE, and make sure to set all these paths (HOME_ORACLE and LD_LIBRARY_PATH) at root level. In my case, I did: su - root export ORACLE_HOME=/usr/lib/oracle/11.1.0.1/client export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/lib I also added the above 2 lines to /etc/profile.d/oracle_libs.sh to make sure it would load correctly when reboots. If you don't have oracle_libs.sh file by default, create one. -- Posted via http://www.ruby-forum.com/.