kimda
2010-Apr-26 17:26 UTC
ruby:0:in `require'': no such file to load -- oci8 (LoadError)
Hi, I am been struggling with oracle db connection from RoR app in my new windows machine which I was able to it n other windows machine a couple of years ago. I installed everything (ruby, rubygem and oracle instant client and ran ruby oci8 command ) and my RoR web app runs ok except oracle DB connection part. I tested from command line like this: C:\ruby_old>ruby -r oci8 -e "OCI8.new(''username'', ''password'', ''jdbc:oracle :thin:@abc.efg.aaa:1521:xxxx).exec(''create table testtab (id1 number)'' ) " ruby:0:in `require'': no such file to load -- oci8 (LoadError) from the RoR web app, I get this error: ORA-12154: TNS:could not resolve the connect identifier specified RAILS_ROOT: ./script/../config/.. Application Trace | Framework Trace | Full Trace env.c:257:in oci8lib.so C:/web/IPSO/app/controllers/attending_ips_controller.rb:140:in `get_most_recent_record'' ... ... Am I missing something here? thanks in advance, Daniel -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Apr-26 21:10 UTC
Re: ruby:0:in `require'': no such file to load -- oci8 (LoadError)
On Apr 26, 6:26 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hi, > > I am been struggling with oracle db connection from RoR app in my new > windows machine which I was able to it n other windows machine a > couple of years ago. > I installed everything (ruby, rubygem and oracle instant client and > ran ruby oci8 command ) and my RoR web app runs ok except oracle DB > connection part. > > I tested from command line like this: > > C:\ruby_old>ruby -r oci8 -e "OCI8.new(''username'', ''password'', > ''jdbc:oracle > :thin:@abc.efg.aaa:1521:xxxx).exec(''create table testtab (id1 number)'' > ) " > ruby:0:in `require'': no such file to load -- oci8 (LoadError) >Assuming oci8 is a gem, you''d need to require rubygems before you can require oci8. If you then get the same error as from the rails app then maybe your connect identifier is indeed bust or perhaps oracle needs more stuff setup (I''ve never used oracle) Fred> from the RoR web app, I get this error: > > ORA-12154: TNS:could not resolve the connect identifier specified > > RAILS_ROOT: ./script/../config/.. > Application Trace | Framework Trace | Full Trace > > env.c:257:in oci8lib.so > C:/web/IPSO/app/controllers/attending_ips_controller.rb:140:in > `get_most_recent_record'' > ... > ... > > Am I missing something here? > > thanks in advance, > Daniel > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
kimda
2010-Apr-26 22:08 UTC
Re: ruby:0:in `require'': no such file to load -- oci8 (LoadError)
After this command, I still get same error. gem install ruby-oci8 -v 2.0.3 my oracle connect identifier works fine in another windows machine that is prod env. So, I assume oracle stuff is ok. On Apr 26, 5:10 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 26, 6:26 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > I am been struggling with oracle db connection from RoR app in my new > > windows machine which I was able to it n other windows machine a > > couple of years ago. > > I installed everything (ruby, rubygem and oracle instant client and > > ran ruby oci8 command ) and my RoR web app runs ok except oracle DB > > connection part. > > > I tested from command line like this: > > > C:\ruby_old>ruby -r oci8 -e "OCI8.new(''username'', ''password'', > > ''jdbc:oracle > > :thin:@abc.efg.aaa:1521:xxxx).exec(''create table testtab (id1 number)'' > > ) " > > ruby:0:in `require'': no such file to load -- oci8 (LoadError) > > Assuming oci8 is a gem, you''d need to require rubygems before you can > require oci8. If you then get the same error as from the rails app > then maybe your connect identifier is indeed bust or perhaps oracle > needs more stuff setup (I''ve never used oracle) > > Fred > > > > > from the RoR web app, I get this error: > > > ORA-12154: TNS:could not resolve the connect identifier specified > > > RAILS_ROOT: ./script/../config/.. > > Application Trace | Framework Trace | Full Trace > > > env.c:257:in oci8lib.so > > C:/web/IPSO/app/controllers/attending_ips_controller.rb:140:in > > `get_most_recent_record'' > > ... > > ... > > > Am I missing something here? > > > thanks in advance, > > Daniel > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Frederick Cheung
2010-Apr-26 22:17 UTC
Re: ruby:0:in `require'': no such file to load -- oci8 (LoadError)
On Apr 26, 11:08 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> After this command, I still get same error. > gem install ruby-oci8 -v 2.0.3 >When I said require rubygems I meant that you need to do -rrubygems as well as -roci8> my oracle connect identifier works fine in another windows machine > that is prod env. So, I assume oracle stuff is ok.Does oracle require any environment variables or configuration files etc ? I know nothing about oracle but http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.html#03_01 seems to suggest that jdbc:oracle:thin is appropriate when using jdbc, which you''re not. Fred> > On Apr 26, 5:10 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > > On Apr 26, 6:26 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, > > > > I am been struggling with oracle db connection from RoR app in my new > > > windows machine which I was able to it n other windows machine a > > > couple of years ago. > > > I installed everything (ruby, rubygem and oracle instant client and > > > ran ruby oci8 command ) and my RoR web app runs ok except oracle DB > > > connection part. > > > > I tested from command line like this: > > > > C:\ruby_old>ruby -r oci8 -e "OCI8.new(''username'', ''password'', > > > ''jdbc:oracle > > > :thin:@abc.efg.aaa:1521:xxxx).exec(''create table testtab (id1 number)'' > > > ) " > > > ruby:0:in `require'': no such file to load -- oci8 (LoadError) > > > Assuming oci8 is a gem, you''d need to require rubygems before you can > > require oci8. If you then get the same error as from the rails app > > then maybe your connect identifier is indeed bust or perhaps oracle > > needs more stuff setup (I''ve never used oracle) > > > Fred > > > > from the RoR web app, I get this error: > > > > ORA-12154: TNS:could not resolve the connect identifier specified > > > > RAILS_ROOT: ./script/../config/.. > > > Application Trace | Framework Trace | Full Trace > > > > env.c:257:in oci8lib.so > > > C:/web/IPSO/app/controllers/attending_ips_controller.rb:140:in > > > `get_most_recent_record'' > > > ... > > > ... > > > > Am I missing something here? > > > > thanks in advance, > > > Daniel > > > > -- > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
kimda
2010-Apr-26 22:45 UTC
Re: ruby:0:in `require'': no such file to load -- oci8 (LoadError)
> When I said require rubygems I meant that you need to do -rrubygems as > well as -roci8hm..I am confusing. do you mean updating gems? If so, I just did and still get same error.> Does oracle require any environment variables or configuration files > etc ? I know nothing about oracle buthttp://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.... > seems to suggest that jdbc:oracle:thin is appropriate when using jdbc, > which you''re not.I downloaded oracle instant client and set env classpath. I indeed use jdbc:oracle:thin like this "jdbc:oracle:thin:@xxx.xxx.org:1521:xxxx" Last year, I also remembered that I downloaded ruby-oci8-x.x.x- mswin32.rb and ran on command line and it copied some files under ruby dir. I don''t know if this done by gem command these days. On Apr 26, 6:17 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Apr 26, 11:08 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > After this command, I still get same error. > > gem install ruby-oci8 -v 2.0.3 > > When I said require rubygems I meant that you need to do -rrubygems as > well as -roci8 > > > my oracle connect identifier works fine in another windows machine > > that is prod env. So, I assume oracle stuff is ok. > > Does oracle require any environment variables or configuration files > etc ? I know nothing about oracle buthttp://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.... > seems to suggest that jdbc:oracle:thin is appropriate when using jdbc, > which you''re not. > > Fred > > > > > > > On Apr 26, 5:10 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > On Apr 26, 6:26 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hi, > > > > > I am been struggling with oracle db connection from RoR app in my new > > > > windows machine which I was able to it n other windows machine a > > > > couple of years ago. > > > > I installed everything (ruby, rubygem and oracle instant client and > > > > ran ruby oci8 command ) and my RoR web app runs ok except oracle DB > > > > connection part. > > > > > I tested from command line like this: > > > > > C:\ruby_old>ruby -r oci8 -e "OCI8.new(''username'', ''password'', > > > > ''jdbc:oracle > > > > :thin:@abc.efg.aaa:1521:xxxx).exec(''create table testtab (id1 number)'' > > > > ) " > > > > ruby:0:in `require'': no such file to load -- oci8 (LoadError) > > > > Assuming oci8 is a gem, you''d need to require rubygems before you can > > > require oci8. If you then get the same error as from the rails app > > > then maybe your connect identifier is indeed bust or perhaps oracle > > > needs more stuff setup (I''ve never used oracle) > > > > Fred > > > > > from the RoR web app, I get this error: > > > > > ORA-12154: TNS:could not resolve the connect identifier specified > > > > > RAILS_ROOT: ./script/../config/.. > > > > Application Trace | Framework Trace | Full Trace > > > > > env.c:257:in oci8lib.so > > > > C:/web/IPSO/app/controllers/attending_ips_controller.rb:140:in > > > > `get_most_recent_record'' > > > > ... > > > > ... > > > > > Am I missing something here? > > > > > thanks in advance, > > > > Daniel > > > > > -- > > > > 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@googlegroups.com. > > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Frederick Cheung
2010-Apr-27 07:30 UTC
Re: ruby:0:in `require'': no such file to load -- oci8 (LoadError)
On 26 Apr, 23:45, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > When I said require rubygems I meant that you need to do -rrubygems as > > well as -roci8 > > hm..I am confusing. do you mean updating gems? If so, I just did and > still get same error. >That''s not what I mean. I mean that if oci8 is a gem then ruby -roci8 won''t be able to load it because to load gems, the rubygems library must be loaded first. The fact that it can''t find oci8 suggest that either this is true or that oci8 isn''t the thing that you need to require.> > Does oracle require any environment variables or configuration files > > etc ? I know nothing about oracle buthttp://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.... > > seems to suggest that jdbc:oracle:thin is appropriate when using jdbc, > > which you''re not. > > I downloaded oracle instant client and set env classpath. I indeed use > jdbc:oracle:thin like this > "jdbc:oracle:thin:@xxx.xxx.org:1521:xxxx" > Last year, I also remembered that I downloaded ruby-oci8-x.x.x- > mswin32.rb and ran on command line and it copied some files under ruby > dir. I don''t know if this done by gem command these days. >Ruby certainly isn''t using jdbc, so you probably don''t want all that jdbc stuff at the front. Fred> On Apr 26, 6:17 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > > > > > On Apr 26, 11:08 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > After this command, I still get same error. > > > gem install ruby-oci8 -v 2.0.3 > > > When I said require rubygems I meant that you need to do -rrubygems as > > well as -roci8 > > > > my oracle connect identifier works fine in another windows machine > > > that is prod env. So, I assume oracle stuff is ok. > > > Does oracle require any environment variables or configuration files > > etc ? I know nothing about oracle buthttp://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.... > > seems to suggest that jdbc:oracle:thin is appropriate when using jdbc, > > which you''re not. > > > Fred > > > > On Apr 26, 5:10 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > > wrote: > > > > > On Apr 26, 6:26 pm, kimda <tkk...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > > Hi, > > > > > > I am been struggling with oracle db connection from RoR app in my new > > > > > windows machine which I was able to it n other windows machine a > > > > > couple of years ago. > > > > > I installed everything (ruby, rubygem and oracle instant client and > > > > > ran ruby oci8 command ) and my RoR web app runs ok except oracle DB > > > > > connection part. > > > > > > I tested from command line like this: > > > > > > C:\ruby_old>ruby -r oci8 -e "OCI8.new(''username'', ''password'', > > > > > ''jdbc:oracle > > > > > :thin:@abc.efg.aaa:1521:xxxx).exec(''create table testtab (id1 number)'' > > > > > ) " > > > > > ruby:0:in `require'': no such file to load -- oci8 (LoadError) > > > > > Assuming oci8 is a gem, you''d need to require rubygems before you can > > > > require oci8. If you then get the same error as from the rails app > > > > then maybe your connect identifier is indeed bust or perhaps oracle > > > > needs more stuff setup (I''ve never used oracle) > > > > > Fred > > > > > > from the RoR web app, I get this error: > > > > > > ORA-12154: TNS:could not resolve the connect identifier specified > > > > > > RAILS_ROOT: ./script/../config/.. > > > > > Application Trace | Framework Trace | Full Trace > > > > > > env.c:257:in oci8lib.so > > > > > C:/web/IPSO/app/controllers/attending_ips_controller.rb:140:in > > > > > `get_most_recent_record'' > > > > > ... > > > > > ... > > > > > > Am I missing something here? > > > > > > thanks in advance, > > > > > Daniel > > > > > > -- > > > > > 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@googlegroups.com. > > > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > > > -- > > > > 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@googlegroups.com. > > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > > -- > > > 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-/JYPxA39Uh4Ykp1iOSErHA@public.gmane.orgm. > > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > > -- > > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group athttp://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.