I''ve trying to use the postgres-pr gem on CentOS/Ruby 1.9.2. When I attempt to run Webrick (or rake update), I get an error saying that it cannot find the gem "postgres." I''m not sure why, because nowhere in my Gemfile or database.yml do I refer to anything called "posgres." Any suggestions? -- 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.
Postgres is confusing (to me). I install "pg (0.10.0)" and that is working for me. I''m currently toying with Rails 3 using Ruby 1.9.2 but I''ve done lots of Ruby 2 using Ruby 1.8 and 1.9.1. If you use the --database=postgresql option when you create your project, it will have this at the top: # PostgreSQL. Versions 7.4 and 8.x are supported. # # Install the pg driver: # gem install pg # On Mac OS X with macports: # gem install pg -- --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config # On Windows: # gem install pg # Choose the win32 build. # Install PostgreSQL and put its /bin directory on your path. Good luck -- 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-/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.
I got the same error using the pr gem... Strange. There is some dependency somewhere that I can''t find. On Jan 15, 3:00 pm, Perry Smith <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Postgres is confusing (to me). I install "pg (0.10.0)" and that is > working for me. I''m currently toying with Rails 3 using Ruby 1.9.2 but > I''ve done lots of Ruby 2 using Ruby 1.8 and 1.9.1. > > If you use the --database=postgresql option when you create your > project, it will have this at the top: > > # PostgreSQL. Versions 7.4 and 8.x are supported. > # > # Install the pg driver: > # gem install pg > # On Mac OS X with macports: > # gem install pg -- > --with-pg-config=/opt/local/lib/postgresql84/bin/pg_config > # On Windows: > # gem install pg > # Choose the win32 build. > # Install PostgreSQL and put its /bin directory on your path. > > Good luck > > -- > Posted viahttp://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-/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.
Is it possible that when you do "gem" you are using a different copy of Ruby than if you run your rails application? There is at least one requirement here: activerecord-2.3.5/lib/active_record/connection_adapters/postgresql_adapter.rb (replace 2.3.5 with your flavor of Rails) begin require_library_or_gem ''pg'' rescue LoadError => e begin require_library_or_gem ''postgres'' class PGresult alias_method :nfields, :num_fields unless self.method_defined?(:nfields) alias_method :ntuples, :num_tuples unless self.method_defined?(:ntuples) alias_method :ftype, :type unless self.method_defined?(:ftype) alias_method :cmd_tuples, :cmdtuples unless self.method_defined?(:cmd_tuples) end rescue LoadError raise e end end -- 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-/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.
Possible... Thanks for the suggestions. I''ll have to try that out. On Jan 15, 4:17 pm, Perry Smith <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Is it possible that when you do "gem" you are using a different copy of > Ruby than if you run your rails application? > > There is at least one requirement here: > > activerecord-2.3.5/lib/active_record/connection_adapters/postgresql_adapter.rb > > (replace 2.3.5 with your flavor of Rails) > > begin > require_library_or_gem ''pg'' > rescue LoadError => e > begin > require_library_or_gem ''postgres'' > class PGresult > alias_method :nfields, :num_fields unless > self.method_defined?(:nfields) > alias_method :ntuples, :num_tuples unless > self.method_defined?(:ntuples) > alias_method :ftype, :type unless self.method_defined?(:ftype) > alias_method :cmd_tuples, :cmdtuples unless > self.method_defined?(:cmd_tuples) > end > rescue LoadError > raise e > end > end > > -- > Posted viahttp://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-/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.