Stan Kaufman
2008-Sep-14 20:26 UTC
Postgres adapter issues with Rails 2.1: ruby-pg is the answer!
While upgrading Rails 2.0.2 sites to Rails 2.1.1, I encountered a weird postgres adapter problem. Although the old postgresql adapter (aka ruby-postgres) works fine with Rails 2.1.1 on my Mac dev box (running PG 8.2.6) and also works fine with Rails 2.0.2 apps on a Debian etch staging server (running PG 8.2.1), this error occurs when trying to cap deploy 2.1.1 apps on the Debian box: "PQserverVersion not supported by this client version". This error occurs at the point of the rake migration task. This error has everything to do with the change from Rails 2.0.2 to 2.1.1; by changing the version of Rails back to 2.0.2 in config/ environment.rb, the rake migration proceeds fine and the PG db connects fine in script/console. This problem is most mysterious, as it didn''t manifest itself on my Mac (the only difference that I can easily see is the slightly newer PG version). However, the solution turns out to be easy: simply use the ruby-pg adapger (https://rubyforge.org/projects/ruby-pg/). The omnipresent Fred C had suggested that this adapter might not work on pre-2.1 apps (http://www.ruby-forum.com/topic/156143), but it appears to work just fine here. Furthermore, the ruby-pg adapter project is in the reliable hands of Jeff Davis, a superstar whose abilities mean that PG has a brilliant future with Rails. Hurrah for that! Anyway, I hope that this saves someone else some time. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
cyril mougel
2008-Sep-15 06:21 UTC
Re: Postgres adapter issues with Rails 2.1: ruby-pg is the answer!
On Sep 14, 10:26 pm, Stan Kaufman <stan.kauf...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> While upgrading Rails 2.0.2 sites to Rails 2.1.1, I encountered a > weird postgres adapter problem. Although the old postgresql adapter > (aka ruby-postgres) works fine with Rails 2.1.1 on my Mac dev box > (running PG 8.2.6) and also works fine with Rails 2.0.2 apps on a > Debian etch staging server (running PG 8.2.1), this error occurs when > trying to cap deploy 2.1.1 apps on the Debian box: "PQserverVersion > not supported by this client version". This error occurs at the point > of the rake migration task. > > This error has everything to do with the change from Rails 2.0.2 to > 2.1.1; by changing the version of Rails back to 2.0.2 in config/ > environment.rb, the rake migration proceeds fine and the PG db > connects fine in script/console. This problem is most mysterious, as > it didn''t manifest itself on my Mac (the only difference that I can > easily see is the slightly newer PG version). > > However, the solution turns out to be easy: simply use the ruby-pg > adapger (https://rubyforge.org/projects/ruby-pg/). The omnipresent > Fred C had suggested that this adapter might not work on pre-2.1 apps > (http://www.ruby-forum.com/topic/156143), but it appears to work just > fine here. > > Furthermore, the ruby-pg adapter project is in the reliable hands of > Jeff Davis, a superstar whose abilities mean that PG has a brilliant > future with Rails. Hurrah for that! > > Anyway, I hope that this saves someone else some time.In Rails edge, ruby-pg is mandatory. ruby-postgres doesn''t work. A report is send in lighthouse : http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/996-nomethoderror-undefined-method-transaction_status-for-pgconn0xb719eb0c#ticket-996-3 -- Cyril Mougel http://blog.shingara.fr/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-/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 -~----------~----~----~----~------~----~------~--~---
Fernando Perez
2008-Oct-19 16:40 UTC
Re: Postgres adapter issues with Rails 2.1: ruby-pg is the answer!
On my Debian Etch box I have installed PostgreSQL from backports repo. When I want to install ruby-pg with "gem1.8 install ruby-pg", I get the following error: -- Building native extensions. This could take a while... ERROR: Error installing ruby-pg: ERROR: Failed to build gem native extension. /usr/bin/ruby1.8 extconf.rb install ruby-pg extconf.rb:1: command not found: pg_config --includedir extconf.rb:52: command not found: pg_config --libdir checking for main() in -lpq... no *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options. -- What additional options should I pass in order to compile the ruby-pg gem? -- Posted via http://www.ruby-forum.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 -~----------~----~----~----~------~----~------~--~---