Getting "Connection not open" error in my rails application
I am a Perl developer and new to Ruby on Rails . Recently, I have setup a new rails application ( Ruby 2.4.0 and Rails 5.0.2 ) . When I launch the application after starting rails server , it generates an error "ORA-06413: Connection not open" . I am using ruby-oci8 (2.2.3) and activerecord-oracle_enhanced-adapter (1.7.9) and oracle client ( 10.1.0 ) . I have also set ORACLE_HOME , LD_LIBRARY_PATH , TNS_ADMIN environment variables in .bash_profile . I am getting below error ;
ORA-06413: Connection not open.
Rails.root: /home/akhand/work_space/test_app Application Trace | Framework Trace | Full Trace
I have configured database.yml and tnsnames.ora correctly but not sure why I am getting this error . Is Oracle 10 is the reason for this error ? Please suggest . FYI , I am able to connect and fetch result of SQL queries manually through the terminal using below command ;
ruby -r oci8 -e "OCI8.new('user', 'password', '//databasehost:1521/testdb').exec('SELECT * FROM application_account') do |r| puts r.join(' | '); end"
But not sure why it's creating problem at rails app level . I tried all the solutions that I found on google but none of them worked .