Dan Bikle
2006-Jul-31 02:16 UTC
[RAILS] PostgreSQL, postgres gem, rails2.pdf, http://ruby.scripting.ca/postgres/ confusion...
Hello people... In the rails2.pdf Dave T says: Rails works with the DB2, MySQL, Oracle, Postgres,... The database drivers are all written in C and are primarily distributed in source form. Then he lists this site: http://ruby.scripting.ca/postgres/ Then he says, There is a pure-Ruby version of the Postgres adapter available. Download postgres-pr from the Ruby-DBI page at http://rubyforge.org/projects/ruby-dbi So I understand all this and I''m happy. But then I bumped into this page: http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx It suggests that I install a gem using a command line like this: gem install postgres So, I tried it and it installed okay. I then rails a tmp_app and edited my database.yml I tested with... rake db:migrate It ran fine. I should be happy but I''m not. Actually I''m happy that I can now do development. But.... I''m not sure how rails is connected to my PostgreSQL database. Q1: What is the best way to connect Rails to PostgreSQL in a Production environment? Q2: For Production, should I use the postgres gem? Q3: The software here: http://ruby.scripting.ca/postgres/ ... Should I try to figure out how to make it serve as a layer between my Rails app and PostgreSQL? Or, should I ignore it? -Dan -------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060731/6940ed8a/attachment.html
Dan Bikle
2006-Jul-31 02:35 UTC
[RAILS] PostgreSQL, postgres gem, rails2.pdf, http://ruby.scripting.ca/postgres/ confusion...
Hi Again, I looked here: ruby/gems/1.8/gems/postgres-0.7.1/README It appears to me that the gem is a wrapper for the code here: http://ruby.scripting.ca/postgres/ So, to answer my own questions: Q1: What is the best way to connect Rails to PostgreSQL in a Production environment? A: Use the gem Q2: For Production, should I use the postgres gem? A: Yes Q3: The software here: http://ruby.scripting.ca/postgres/ ... Should I try to figure out how to make it serve as a layer between my Rails app and PostgreSQL? Or, should I ignore it? A: Ignore it -Dan On 7/30/06, Dan Bikle <dan.bikle@gmail.com> wrote:> > Hello people... > > In the rails2.pdf Dave T says: > > Rails works with the DB2, MySQL, Oracle, Postgres,... > > The database drivers are all written in C and are primarily distributed in > > source form. > > Then he lists this site: > http://ruby.scripting.ca/postgres/ > > Then he says, > > There is a pure-Ruby version of the Postgres adapter available. Download > postgres-pr from the Ruby-DBI page at > http://rubyforge.org/projects/ruby-dbi > > So I understand all this and I''m happy. > > But then I bumped into this page: > > > http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx > > It suggests that I install a gem using a command line like this: > > gem install postgres > > So, I tried it and it installed okay. > > I then rails a tmp_app and edited my database.yml > > I tested with... > > rake db:migrate > > It ran fine. > > I should be happy but I''m not. > Actually I''m happy that I can now do development. > > But.... > I''m not sure how rails is connected to my PostgreSQL database. > > Q1: What is the best way to connect Rails to PostgreSQL in a Production > environment? > > Q2: For Production, should I use the postgres gem? > > Q3: The software here: http://ruby.scripting.ca/postgres/ ... > Should I try to figure out how to make it serve as a layer between my > Rails app > and PostgreSQL? Or, should I ignore it? > > -Dan > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://wrath.rubyonrails.org/pipermail/rails/attachments/20060731/7f709eb5/attachment.html
Janeve George
2006-Aug-08 04:57 UTC
[Rails] Re: PostgreSQL, postgres gem, rails2.pdf, http://ruby.script
Dan Bikle wrote:> Hi Again, > > I looked here: > > ruby/gems/1.8/gems/postgres-0.7.1/README > > It appears to me that the gem is a wrapper for the code here: > > http://ruby.scripting.ca/postgres/ > > So, to answer my own questions: > > Q1: What is the best way to connect Rails to PostgreSQL in a Production > environment? > A: Use the gem > > Q2: For Production, should I use the postgres gem? > A: Yes > > Q3: The software here: http://ruby.scripting.ca/postgres/ ... > Should I try to figure out how to make it serve as a layer between > my > Rails app > and PostgreSQL? Or, should I ignore it? > A: Ignore it > > -DanHi All, I am a newbie in Ruby-Rails. Actually we are using postgre SQL and Ruby application to access the DB. I have made the controller and the model classes. My database.yml contains: development: adapter: postgresql database: test username: poc password: poc host: localhost:5000 test: adapter: postgresql database: test username: poc password: poc host: localhost:5000 production: adapter: postgresql database: test username: poc password: poc host: localhost:5000 I have actually configured my postgresql to listen to port 5000 rather than 5432(default). When I hit the url http://127.0.0.1:3000/Testing/new it is showing an error: Bad file descriptor - connect(2) My model -> testing.rb class Testing < ActiveRecord::Base end My Controller -> testing_controller.rb class TestingController < ApplicationController scaffold :testing end How can I resolve this problem... Thanks in advance... Regards, Janeve -- Posted via http://www.ruby-forum.com/.
Robert Treat
2006-Aug-08 15:15 UTC
[Rails] Re: PostgreSQL, postgres gem, rails2.pdf, http://ruby.script
Janeve George <janeve_reckoner@...> writes:> Hi All, > > I am a newbie in Ruby-Rails. Actually we are using postgre SQL and Ruby > application to access the DB. I have made the controller and the model > classes. My database.yml contains: > > development: > adapter: postgresql > database: test > username: poc > password: poc > host: localhost:5000<snip relevant text to get under the gmane.org posting requirements>> > How can I resolve this problem... Thanks in advance...These are the comments that used to be in the default database.yml file... not sure whose donkey idea was it to remove all this stuff? :-) Anyway maybe it will help you: # Connect on a TCP socket. Omitted by default since the client uses a # domain socket that doesn''t need configuration. #host: remote-database #port: 5432 Robert Treat