I run ruby script on CentOS and installed ruby via rvm (1.9.3).
I set the NLS_LANG variable to .bash_profile.
[app@box stasis]$ echo $NLS_LANG
en_US.UTF-8
[app@box stasis]$ which ruby
~/.rvm/rubies/ruby-1.9.3-p194/bin/ruby
However, trying to access it through ruby (which the oci8 driver does), it cannot find it:
1.9.3-p194 :001 > ENV['NLS_LANG']
=> nil
Access to other vars seems to work:
1.9.3-p194 :004 > ENV['USER']
=> "app"
My script shows the following: Warning: NLS_LANG is not set. fallback to US7ASCII.
Thing: I run sqlplus from a ruby script (to execute some .sql files), and special characters are all messed up.
How can I get a ruby to see the value?
source
share