cgswathy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-17 18:25 UTC
Ruby error with postgres
Im getting the following error while using postgres from ruby. Im new to ruby any help would be appreciated. c:/ruby/lib/ruby/1.8/readbytes.rb:21:in `read'': Invalid argument (Errno::EINVAL) from c:/ruby/lib/ruby/1.8/readbytes.rb:21:in `readbytes'' from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ message.rb:32:in `read'' from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ connection.rb:30:in `initialize'' from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ connection.rb:29:in `loop'' from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ connection.rb:29:in `initialize'' from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ postgres-compat.rb:23:in `new'' from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ postgres-compat.rb:23:in `initialize'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/postgresql_adapter.rb:24:in `connect'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/postgresql_adapter.rb:24:in `postgresql_connection'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 262:in `send'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 262:in `connection_without_query_cache='' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/query_cache.rb:54:in `connection='' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 230:in `retrieve_connection'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/connection_adapters/abstract/connection_specification.rb: 78:in `connection'' from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ active_record/base.rb:427:in `find_by_sql'' --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
That''s because Rails can''t read from the connection. Try restarting postgresql. On 7/17/07, cgswathy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <cgswathy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Im getting the following error while using postgres from ruby. Im new > to ruby any help would be appreciated. > > c:/ruby/lib/ruby/1.8/readbytes.rb:21:in `read'': Invalid argument > (Errno::EINVAL) > from c:/ruby/lib/ruby/1.8/readbytes.rb:21:in `readbytes'' > from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ > message.rb:32:in `read'' > from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ > connection.rb:30:in `initialize'' > from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ > connection.rb:29:in `loop'' > from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ > connection.rb:29:in `initialize'' > from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ > postgres-compat.rb:23:in `new'' > from c:/ruby/lib/ruby/gems/1.8/gems/postgres-pr-0.4.0/lib/postgres-pr/ > postgres-compat.rb:23:in `initialize'' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/postgresql_adapter.rb:24:in > `connect'' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/postgresql_adapter.rb:24:in > `postgresql_connection'' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/abstract/connection_specification.rb: > 262:in `send'' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/abstract/connection_specification.rb: > 262:in `connection_without_query_cache='' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/query_cache.rb:54:in `connection='' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/abstract/connection_specification.rb: > 230:in `retrieve_connection'' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/connection_adapters/abstract/connection_specification.rb: > 78:in `connection'' > from c:/ruby/lib/ruby/gems/1.8/gems/activerecord-1.15.3/lib/ > active_record/base.rb:427:in `find_by_sql'' > > > > >-- Dan Sketcher www.peoplehub.com.au www.dansketcher.com --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---