# Problem with rubyscript2exe, OCI8, registry

**URL:** <https://www.ruby-forum.com/t/problem-with-rubyscript2exe-oci8-registry/107822>\
**Category:** Ruby\
**Created:** [June 26, 2007, 3:25pm UTC](https://www.ruby-forum.com/t/problem-with-rubyscript2exe-oci8-registry/107822 "2007-06-26T15:25:34Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [June 26, 2007, 3:25pm UTC](https://www.ruby-forum.com/t/problem-with-rubyscript2exe-oci8-registry/107822/1 "2007-06-26T15:25:34Z")

</div>

Hi,

Ruby 1.8.6  
Rubyscript2exe 0.5.3  
OCI8 1.0.0rc2  
Windows XP Pro

I wrote a program that uses DBI + OCI8. It compiles fine, but when I  
run the executable I get an NLS\_LANG error from Oracle. This does not  
happen if I run it from the command line.

env.c:257:in oci8lib.so: ORA-12705: invalid or unknown NLS parameter  
value specified (DBI::DatabaseError)  
from C:/DOCUME~1/djberge/eee/eee.ntm.exe.3/lib/oci8.rb:210:in  
`initialize' from C:/DOCUME~1/djberge/eee/eee.ntm.exe.3/lib/DBD/OCI8/ OCI8.rb:54:in`new’  
from C:/DOCUME~1/djberge/eee/eee.ntm.exe.3/lib/DBD/OCI8/  
OCI8.rb:54:in `connect' from C:/DOCUME~1/djberge/eee/eee.ntm.exe.3/lib/dbi.rb:424:in`connect’  
from C:/DOCUME~1/djberge/eee/eee.ntm.exe.3/lib/dbi.rb:215:in  
`connect' from C:\DOCUME~1\djberge\eee\eee.ntm.exe.3\app\ntm.rb:16 from C:\DOCUME~1\djberge\eee\eee.ntm.exe.3\bootstrap.rb:77:in`load’  
from C:\DOCUME~1\djberge\eee\eee.ntm.exe.3\bootstrap.rb:77

The only way that can happen is if it’s reading from the registry,  
because I definitely do NOT have an NLS\_LANG environment variable set,  
though it’s set in the registry to “NA” (North America). I tried  
several things - explicitly setting the NLS\_LANG environment variable  
to nil, setting ORACLE\_HOME and/or TNS\_ADMIN explicitly, etc.

However, the only thing that worked was to literally rename the  
NLS\_LANG registry entry under  
HKEY\_LOCAL\_MACHINE/Software/Oracle.

Why is that happening?

Thanks,

Dan

---

<div class="post-metadata">

**Author:** ![danielb](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/c57346/32.png) [@danielb](https://www.ruby-forum.com/u/danielb)\
**Post date:** [June 27, 2007, 8:53pm UTC](https://www.ruby-forum.com/t/problem-with-rubyscript2exe-oci8-registry/107822/2 "2007-06-27T20:53:44Z")

</div>

On Jun 26, 7:24 am, Daniel B. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hi,
> 
> Ruby 1.8.6Rubyscript2exe0.5.3  
> OCI8 1.0.0rc2  
> Windows XP Pro
> 
> I wrote a program that uses DBI + OCI8. It compiles fine, but when I  
> run the executable I get an NLS\_LANG error fromOracle. This does not  
> happen if I run it from the command line.

I found that doing this at the top of the script solved the problem:

ENV[‘NLS\_LANG’] = “AMERICAN\_AMERICA.WE8ISO8859P15”

YMMV.

Regards,

Dan
