ORA-12514: TNS:listener d oes not currently know of service requested in connect descriptor (OCIEr

Hi I am a new to ROR and learning this framework from various tutorials.
I have my new application and had the rails generate scaffold get going
but after this when I first ran the rake db:migrate I got this ERROR!

ORA-12514:
TNS:listener d
oes not currently know of service requested in connect descriptor
(OCIError)

I’m using database which is on a server and have used the tnsnames.ora
configs so my database.yml looks like

development:
adapter: oracle_enhanced
database: contrl
username: ucontrl
password: control123

after some search related to the error I happen to check this link "
ActiveRecord/Oracle without Rails - Ruby - Ruby-Forum " and followed the procedures but
now I am stuck with the below error

C:\Documents and
Settings\SawanKumar.Thammadi\RubyOnRails\datamanger>rake db:migrate
(in C:/Documents and
Settings/SawanKumar.Thammadi/RubyOnRails/datamanger)
rake aborted!
OCI Library Initialization Error
oci8lib.c:98:in oci8lib_191.so
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in
r equire' . . . C:/Ruby192/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.0.4-x86-mingw32/lib/oci8.rb:23:in <top (required)>’
.
.
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-oracle_enhanced-adapter-1.3.1/lib/active_record/con
nection_adapters/oracle_enhanced_oci_connection.rb:4:in <top (required)>' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in r
equire’
.
.
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-oracle_enhanced-adapter-1.3.1/lib/active_record/con
nection_adapters/oracle_enhanced_connection.rb:114:in <top (required)>' . . . C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-oracle_enhanced-adapter-1.3.1/lib/active_record/con nection_adapters/oracle_enhanced_adapter.rb:36:in <top (required)>’
.
.
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-oracle_enhanced-adapter-1.3.1/lib/activerecord-orac
le_enhanced-adapter.rb:12:in block in <class:OracleEnhancedRailtie>' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in instance_eval’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:36:in
execute_hook' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:43:in block in run_load_hooks’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:42:in
each' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/lazy_load_hooks.rb:42:in run_load_hooks’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activerecord-3.0.3/lib/active_record/base.rb:1891:in
<top (requ ired)>' C:/Documents and Settings/SawanKumar.Thammadi/RubyOnRails/datamanger/config/initializers/active_reco rd.rb:1:in <top (required)>’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in
l oad' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in b
lock in load’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in
b lock in load_dependency' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:596:in n
ew_constants_in’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:225:in
l oad_dependency' C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:235:in l
oad’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:201:in
block (2 levels) in < class:Engine>' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:200:in each’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/engine.rb:200:in
block in <class:Engin e>' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in instance_exec’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:25:in
run' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:50:in block in run_in
itializers’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in
each' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/initializable.rb:49:in run_initializer
s’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:134:in
initialize!' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:77:in method_missing’
C:/Documents and
Settings/SawanKumar.Thammadi/RubyOnRails/datamanger/config/environment.rb:5:in
<to p (required)>' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:103:in require’
C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:103:in
require_environm ent!' C:/Ruby192/lib/ruby/gems/1.9.1/gems/railties-3.0.3/lib/rails/application.rb:216:in block in initial
ize_tasks’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in call' C:/Ruby192/lib/ruby/1.9.1/rake.rb:634:in block in execute’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in each' C:/Ruby192/lib/ruby/1.9.1/rake.rb:629:in execute’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:595:in block in invoke_with_call_chain' C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in invoke_with_call_chain' C:/Ruby192/lib/ruby/1.9.1/rake.rb:605:in block in invoke_prerequisites’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in each' C:/Ruby192/lib/ruby/1.9.1/rake.rb:602:in invoke_prerequisites’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:594:in block in invoke_with_call_chain' C:/Ruby192/lib/ruby/1.9.1/monitor.rb:201:in mon_synchronize’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:588:in invoke_with_call_chain' C:/Ruby192/lib/ruby/1.9.1/rake.rb:581:in invoke’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2041:in invoke_task' C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in block (2 levels) in
top_level’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in each' C:/Ruby192/lib/ruby/1.9.1/rake.rb:2019:in block in top_level’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:2058:in standard_exception_handling' C:/Ruby192/lib/ruby/1.9.1/rake.rb:2013:in top_level’
C:/Ruby192/lib/ruby/1.9.1/rake.rb:1992:in run' C:/Ruby192/bin/rake:31:in

Please help me anyone!!!

ORA-12514:
TNS:listener d
oes not currently know of service requested in connect descriptor
(OCIError)

Just a guess… Is it possible that your database name is misspelled
compared to the contents of TNSNAMES.ORA?

C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in

`r
equire’

Have you installed the ruby-oci8 gem? (http://ruby-oci8.rubyforge.org/
en/InstallBinaryPackage.html)

pepe wrote in post #968708:

C:/Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.3/lib/active_support/dependencies.rb:239:in

`r
equire’

Have you installed the ruby-oci8 gem? (http://ruby-oci8.rubyforge.org/
en/InstallBinaryPackage.html)

"Hi Thanks for the reply I have found the problem. When I was trying to
connect to the database I tried
irb>
irb>0>require ‘oci8’
irb>0>true
irb>1>OCI8.new(‘username’,‘password’,‘database name’)
irb>1>OCI8(databsename)

the above confirmed that the tns names were working but the when I run
the rake db:migrate it still says the listener did not recognize the
service name. Then I looked into the oracle_enhanced_oci_connection.rb
the connection according to TNS alias was pretty much trying to grab the
dynamic value I believe from the database.yml then I tried to change the
connection query
##conn = OCI8.new username, password, connection_string, privilege

    conn = OCI8.new('username','password','databasename')

and executed the command rake db:migrate it made the connection and
migration was successful

I still do not understand why it happened and is their any permanent
solution "