pepe
2008-Jun-26 02:52 UTC
Switching to production - OCIError (ORA-12154: TNS:could not resolve the connect identifier specified):
Hi all. Ruby version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] Rails version: rails 1.2.3 I finished my first RoR application (Rails and Oracle, using the oci adapter). I am pretty close to production install time and I thought I had done my homework and learned how to setup the production environment: - I changed ''environment.rb'' and un-commented the line ENV[''RAILS_ENV''] ||= ''production''. - To make sure I was using the correct database I even commented out the development and test sections in the ''database.yml'' file. When I tested the application with WEBrick everything looked good. Then I installed Mongrel as a Windows service following the instructions that can be found at http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-native-windows.html and realized that something is wrong with the production environment when I got the error. I can indeed see the service and I can start and stop it and seems to be working fine. But after the service is running, when I start the application I get the error above. I also get the same error if I start Mongrel (mongrel_rails start -p 3000 -e production) or WEBrick (ruby script/server webrick -p 3000 -e production) manually to use the production environment, as you can see in the -e parameter. I have noticed that if I don''t specify the production environment Mongrel tells me that it''s starting the development one. And both servers do log all activity in the development log file. What is that I am missing here to make the whole thing work in production? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pavankumar Kulkarni
2008-Jun-26 03:32 UTC
Re: Switching to production - OCIError (ORA-12154: TNS:could not resolve the connect identifier specified):
hey, can u post ur database.yml ? looks like production and development connections are different and not setup correctly. Also confirm that TNSNAMES.ORA has entry for both (dev and prod) of your config. -Pavan ----- Original Message ----- From: "pepe" <Pepe-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org> To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> Sent: Wednesday, June 25, 2008 7:52 PM Subject: [Rails] Switching to production - OCIError (ORA-12154: TNS:could not resolve the connect identifier specified):> > Hi all. > > Ruby version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] > Rails version: rails 1.2.3 > > I finished my first RoR application (Rails and Oracle, using the oci > adapter). I am pretty close to production install time and I thought I > had done my homework and learned how to setup the production > environment: > > - I changed ''environment.rb'' and un-commented the line > ENV[''RAILS_ENV''] ||= ''production''. > > - To make sure I was using the correct database I even commented out > the development and test sections in the ''database.yml'' file. > > When I tested the application with WEBrick everything looked good. > Then I installed Mongrel as a Windows service following the > instructions that can be found at > http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-native-windows.html > and realized that something is wrong with the production environment > when I got the error. > > I can indeed see the service and I can start and stop it and seems to > be working fine. But after the service is running, when I start the > application I get the error above. I also get the same error if I > start Mongrel (mongrel_rails start -p 3000 -e production) or WEBrick > (ruby script/server webrick -p 3000 -e production) manually to use the > production environment, as you can see in the -e parameter. > > I have noticed that if I don''t specify the production environment > Mongrel tells me that it''s starting the development one. And both > servers do log all activity in the development log file. > > What is that I am missing here to make the whole thing work in > production? > > Thanks. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
pepe
2008-Jun-26 12:19 UTC
Re: Switching to production - OCIError (ORA-12154: TNS:could not resolve the connect identifier specified):
Hello Pavan, I don''t think the problem is in database.yml. The box where I''m trying to make this work is a test box with same setup as the production box will have. It has a unique database, so when I ''switch'' between development and production the database is actually the same. The ''development'' and ''test'' sections are all commented out now and everything works fine if I start the web servers without specifying the production environment (-e production). This is what I have in the ''production'' section of ''database.yml'' (I''m going by memory here): production: adapter: oracle host: localhost database: XE user: myUser pwd: myPassword I don''t have 2 different entries in TNSNAMES.ORA either. I didn''t think I needed them since there is only one database to connect to. Does that matter? Thanks! Pepe On Jun 25, 11:32 pm, "Pavankumar Kulkarni" <bkpa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> hey, can u post ur database.yml ? looks like production and development > connections are different and not setup correctly. Also confirm that > TNSNAMES.ORA has entry for both (dev and prod) of your config. > > -Pavan > > ----- Original Message ----- > From: "pepe" <P...-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org> > To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > Sent: Wednesday, June 25, 2008 7:52 PM > Subject: [Rails] Switching to production - OCIError (ORA-12154: TNS:could > > not resolve the connect identifier specified): > > > Hi all. > > > Ruby version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] > > Rails version: rails 1.2.3 > > > I finished my first RoR application (Rails and Oracle, using the oci > > adapter). I am pretty close to production install time and I thought I > > had done my homework and learned how to setup the production > > environment: > > > - I changed ''environment.rb'' and un-commented the line > > ENV[''RAILS_ENV''] ||= ''production''. > > > - To make sure I was using the correct database I even commented out > > the development and test sections in the ''database.yml'' file. > > > When I tested the application with WEBrick everything looked good. > > Then I installed Mongrel as a Windows service following the > > instructions that can be found at > >http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-nativ... > > and realized that something is wrong with the production environment > > when I got the error. > > > I can indeed see the service and I can start and stop it and seems to > > be working fine. But after the service is running, when I start the > > application I get the error above. I also get the same error if I > > start Mongrel (mongrel_rails start -p 3000 -e production) or WEBrick > > (ruby script/server webrick -p 3000 -e production) manually to use the > > production environment, as you can see in the -e parameter. > > > I have noticed that if I don''t specify the production environment > > Mongrel tells me that it''s starting the development one. And both > > servers do log all activity in the development log file. > > > What is that I am missing here to make the whole thing work in > > production? > > > Thanks.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Pavankumar Kulkarni
2008-Jun-30 22:22 UTC
Re: Switching to production - OCIError (ORA-12154: TNS:could not resolve the connect identifier specified):
Hey Pepe, If I understand your setup right, you have a single instance of oracle (SID: XE) with two users. One for development database and the other one for production. In such a case you do not need separate TNSNAMES entries. http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/81265d60a3d8b9e1has some details. Hope it helps! On Thu, Jun 26, 2008 at 5:19 AM, pepe <Pepe-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org> wrote:> > Hello Pavan, > > I don''t think the problem is in database.yml. The box where I''m trying > to make this work is a test box with same setup as the production box > will have. It has a unique database, so when I ''switch'' between > development and production the database is actually the same. The > ''development'' and ''test'' sections are all commented out now and > everything works fine if I start the web servers without specifying > the production environment (-e production). This is what I have in the > ''production'' section of ''database.yml'' (I''m going by memory here): > > production: > adapter: oracle > host: localhost > database: XE > user: myUser > pwd: myPassword > > I don''t have 2 different entries in TNSNAMES.ORA either. I didn''t > think I needed them since there is only one database to connect to. > Does that matter? > > Thanks! > > Pepe > > On Jun 25, 11:32 pm, "Pavankumar Kulkarni" <bkpa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > hey, can u post ur database.yml ? looks like production and development > > connections are different and not setup correctly. Also confirm that > > TNSNAMES.ORA has entry for both (dev and prod) of your config. > > > > -Pavan > > > > ----- Original Message ----- > > From: "pepe" <P...-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org> > > To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > Sent: Wednesday, June 25, 2008 7:52 PM > > Subject: [Rails] Switching to production - OCIError (ORA-12154: TNS:could > > > > not resolve the connect identifier specified): > > > > > Hi all. > > > > > Ruby version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] > > > Rails version: rails 1.2.3 > > > > > I finished my first RoR application (Rails and Oracle, using the oci > > > adapter). I am pretty close to production install time and I thought I > > > had done my homework and learned how to setup the production > > > environment: > > > > > - I changed ''environment.rb'' and un-commented the line > > > ENV[''RAILS_ENV''] ||= ''production''. > > > > > - To make sure I was using the correct database I even commented out > > > the development and test sections in the ''database.yml'' file. > > > > > When I tested the application with WEBrick everything looked good. > > > Then I installed Mongrel as a Windows service following the > > > instructions that can be found at > > >http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-nativ. > .. > > > and realized that something is wrong with the production environment > > > when I got the error. > > > > > I can indeed see the service and I can start and stop it and seems to > > > be working fine. But after the service is running, when I start the > > > application I get the error above. I also get the same error if I > > > start Mongrel (mongrel_rails start -p 3000 -e production) or WEBrick > > > (ruby script/server webrick -p 3000 -e production) manually to use the > > > production environment, as you can see in the -e parameter. > > > > > I have noticed that if I don''t specify the production environment > > > Mongrel tells me that it''s starting the development one. And both > > > servers do log all activity in the development log file. > > > > > What is that I am missing here to make the whole thing work in > > > production? > > > > > Thanks. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
pepe
2008-Jul-01 12:24 UTC
Re: Switching to production - OCIError (ORA-12154: TNS:could not resolve the connect identifier specified):
Hi Pavan. Very close but not perfect. :) Single instance of oracle (XE). Single database. Single user for both development and production environments. I was just trying to switch from ''development'' to ''production'' by modifying setup values and installing Mongrel as a Windows service since it''s supposed to be quite faster than WEBrick. Seemed simple but didn''t work for me, giving me the OCI error I mentioned in the first post. BTW, just to see if there is something wrong with the service I created another one for Mongrel but in ''development mode'' and it''s been working fine, so I know it has nothing to do with the services. I had just a minute yesterday to take a look at the link you posted. I think I''ve done many of the things in it if not all but I''ll take a closer look as soon as I can to see if there is something there that I can use. Thanks a lot. Pepe On Jun 30, 6:22 pm, "Pavankumar Kulkarni" <bkpa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hey Pepe, > If I understand your setup right, you have a single instance of oracle (SID: > XE) with two users. One for development database and the other one for > production. In such a case you do not need separate TNSNAMES entries. > > http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/... > some details. > > Hope it helps! > > On Thu, Jun 26, 2008 at 5:19 AM, pepe <P...-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org> wrote: > > > Hello Pavan, > > > I don''t think the problem is in database.yml. The box where I''m trying > > to make this work is a test box with same setup as the production box > > will have. It has a unique database, so when I ''switch'' between > > development and production the database is actually the same. The > > ''development'' and ''test'' sections are all commented out now and > > everything works fine if I start the web servers without specifying > > the production environment (-e production). This is what I have in the > > ''production'' section of ''database.yml'' (I''m going by memory here): > > > production: > > adapter: oracle > > host: localhost > > database: XE > > user: myUser > > pwd: myPassword > > > I don''t have 2 different entries in TNSNAMES.ORA either. I didn''t > > think I needed them since there is only one database to connect to. > > Does that matter? > > > Thanks! > > > Pepe > > > On Jun 25, 11:32 pm, "Pavankumar Kulkarni" <bkpa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > hey, can u post ur database.yml ? looks like production and development > > > connections are different and not setup correctly. Also confirm that > > > TNSNAMES.ORA has entry for both (dev and prod) of your config. > > > > -Pavan > > > > ----- Original Message ----- > > > From: "pepe" <P...-gUAqH5+0sKL6V6G2DxALlg@public.gmane.org> > > > To: "Ruby on Rails: Talk" <rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org> > > > Sent: Wednesday, June 25, 2008 7:52 PM > > > Subject: [Rails] Switching to production - OCIError (ORA-12154: TNS:could > > > > not resolve the connect identifier specified): > > > > > Hi all. > > > > > Ruby version: ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] > > > > Rails version: rails 1.2.3 > > > > > I finished my first RoR application (Rails and Oracle, using the oci > > > > adapter). I am pretty close to production install time and I thought I > > > > had done my homework and learned how to setup the production > > > > environment: > > > > > - I changed ''environment.rb'' and un-commented the line > > > > ENV[''RAILS_ENV''] ||= ''production''. > > > > > - To make sure I was using the correct database I even commented out > > > > the development and test sections in the ''database.yml'' file. > > > > > When I tested the application with WEBrick everything looked good. > > > > Then I installed Mongrel as a Windows service following the > > > > instructions that can be found at > > > >http://noobonrails.blogspot.com/2006/06/how-to-setup-mongrel-as-nativ. > > .. > > > > and realized that something is wrong with the production environment > > > > when I got the error. > > > > > I can indeed see the service and I can start and stop it and seems to > > > > be working fine. But after the service is running, when I start the > > > > application I get the error above. I also get the same error if I > > > > start Mongrel (mongrel_rails start -p 3000 -e production) or WEBrick > > > > (ruby script/server webrick -p 3000 -e production) manually to use the > > > > production environment, as you can see in the -e parameter. > > > > > I have noticed that if I don''t specify the production environment > > > > Mongrel tells me that it''s starting the development one. And both > > > > servers do log all activity in the development log file. > > > > > What is that I am missing here to make the whole thing work in > > > > production? > > > > > Thanks.--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---