I installed Ruby with Oracle 10g and ran the ruby ...mswin.rb for oracle following the Oracle Ruby FAQ. But then when I try to test the connection using the following command ruby -r oci8 -e "OCI8.new(''cm'',''pass'',''databasename'').exec(''SELECT * FROM PLATFORMS'');" it returns nothing from the database. I''m not getting any TNSListner errors. Not error messages what so ever, but no data either. HELP!!! --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
I had problems with the connection at first too. Here is what I am using: development: adapter: oci host: 192.168.2.1/SID_NAME.world username: userId1 password: password1 The host included not just the SID, but the entire oracle service name (that .world thing). On Feb 7, 3:47 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I installed Ruby with Oracle 10g and ran the ruby ...mswin.rb for > oracle following the Oracle Ruby FAQ. But then when I try to test the > connection using the following command > > ruby -r oci8 -e "OCI8.new(''cm'',''pass'',''databasename'').exec(''SELECT * > FROM PLATFORMS'');" it returns nothing from the database. I''m not > getting any TNSListner errors. Not error messages what so ever, but no > data either. HELP!!!--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thanks for the reply. I''ll try it, but I don''t think database.rb would make a difference if I''m running ruby from command line just to test the database connection. Any other ideas? On Feb 7, 6:29 pm, FnMike <mikefa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> I had problems with the connection at first too. Here is what I am > using: > > development: > adapter: oci > host: 192.168.2.1/SID_NAME.world > username: userId1 > password: password1 > > The host included not just the SID, but the entire oracle service > name (that .world thing). > > On Feb 7, 3:47 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I installed Ruby with Oracle 10g and ran the ruby ...mswin.rb for > > oracle following the Oracle Ruby FAQ. But then when I try to test the > > connection using the following command > > > ruby -r oci8 -e "OCI8.new(''cm'',''pass'',''databasename'').exec(''SELECT * > > FROM PLATFORMS'');" it returns nothing from the database. I''m not > > getting any TNSListner errors. Not error messages what so ever, but no > > data either. HELP!!!- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Hi, No error message means you have connected to Oracle db successfully. The following command will show the data you want: ruby -r oci8 -e "OCI8.new(''cm'',''pass'',''databasename'').exec(''SELECT * FROM PLATFORMS'') *do |r| puts r.join('',''); end*" 2008/2/8, lxp149 <luying.pan-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>:> > > Thanks for the reply. I''ll try it, but I don''t think database.rb would > make a difference if I''m running ruby from command line just to test > the database connection. Any other ideas? > > On Feb 7, 6:29 pm, FnMike <mikefa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > I had problems with the connection at first too. Here is what I am > > using: > > > > development: > > adapter: oci > > host: 192.168.2.1/SID_NAME.world > > username: userId1 > > password: password1 > > > > The host included not just the SID, but the entire oracle service > > name (that .world thing). > > > > On Feb 7, 3:47 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > > > > I installed Ruby with Oracle 10g and ran the ruby ...mswin.rb for > > > oracle following the Oracle Ruby FAQ. But then when I try to test the > > > connection using the following command > > > > > ruby -r oci8 -e "OCI8.new(''cm'',''pass'',''databasename'').exec(''SELECT * > > > FROM PLATFORMS'');" it returns nothing from the database. I''m not > > > getting any TNSListner errors. Not error messages what so ever, but no > > > data either. HELP!!!- Hide quoted text - > > > > - Show quoted text - > > >-- Best regards, Jesse --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Wow this was confusing. i figured out that not only do you have to run the mswin.rb oracle adapter, but you also have to manually copy the oracle_adapter.rb to the proper activerecord directory (where all the other database adapters are located). Only with both of those things in place, can you run a ruby application over oracle. if you only install the mswin oracle adapter, you can only execute sql queries from ruby from command line without errors, but you won''t be able to successfully run the generate script. Anyway thanks for the reply. This problem was even sillier because I didn''t understand the ruby language at the time and had no idea that "puts" was the same as printf, so I wasn''t actually printing anything out :D On Feb 18, 4:44 am, "Jesse Hu" <yiz...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > No error message means you have connected to Oracle db successfully. > The following command will show the data you want: > ruby -r oci8 -e "OCI8.new(''cm'',''pass'',''databasename'').exec(''SELECT * > FROM PLATFORMS'') *do |r| puts r.join('',''); end*" > > 2008/2/8, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>: > > > > > > > Thanks for the reply. I''ll try it, but I don''t think database.rb would > > make a difference if I''m running ruby from command line just to test > > the database connection. Any other ideas? > > > On Feb 7, 6:29 pm, FnMike <mikefa...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > I had problems with the connection at first too. Here is what I am > > > using: > > > > development: > > > adapter: oci > > > host: 192.168.2.1/SID_NAME.world > > > username: userId1 > > > password: password1 > > > > The host included not just the SID, but the entire oracle service > > > name (that .world thing). > > > > On Feb 7, 3:47 pm, lxp149 <luying....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > I installed Ruby with Oracle 10g and ran the ruby ...mswin.rb for > > > > oracle following the Oracle Ruby FAQ. But then when I try to test the > > > > connection using the following command > > > > > ruby -r oci8 -e "OCI8.new(''cm'',''pass'',''databasename'').exec(''SELECT * > > > > FROM PLATFORMS'');" it returns nothing from the database. I''m not > > > > getting any TNSListner errors. Not error messages what so ever, but no > > > > data either. HELP!!!- Hide quoted text - > > > > - Show quoted text - > > -- > Best regards, > Jesse--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---