Forgive me for asking a trivial question on this list, but being new
to Ruby/Ruby on Rails, I''m not sure where to start....
I''m trying to connect to a postgresql server:
My database.yml contains:
test_test:
adapter: postgresql
database: test_test
username: testuser
password: resutest
host: testpgserver
port: 5432
encoding: UTF8
min_messages: warning
The database is setup and talking with Java and Perl from the same
client as I''m trying to use Ruby on Rails on.
The command
ruby script/generate scaffold Product Admin
produces
--------------error--------------
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:73:in
`establish_connection'': development database is not configured
(ActiveRecord::AdapterNotSpecified)
from
/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/connection_adapters/abstract/connection_specification.rb:66:in
`establish_connection''
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:169:in
`initialize_database''
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:83:in
`process''
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/initializer.rb:42:in `run''
from ./script/../config/../config/environment.rb:10
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require''
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
`require''
from
/usr/lib/ruby/gems/1.8/gems/rails-1.0.0/lib/commands/generate.rb:1
from /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:21:in
`require''
from
/usr/lib/ruby/gems/1.8/gems/activesupport-1.2.5/lib/active_support/dependencies.rb:214:in
`require''
from script/generate:3
--------------error--------------
running interactively using irb I have no problems connecting and
talking to the db.
irb(main):018:0> require "postgres"
=> true
conn=PGconn.connect("testpgserver",5432,"","","test_test","testuser","resutest")
=> #<PGconn:0x2aaaab567ae8>
Please help!
> I''m trying to connect to a postgresql server: > > My database.yml contains: > > test_test:Replace test_test with either development, test or production.> adapter: postgresql > database: test_test > username: testuser > password: resutest > host: testpgserver > port: 5432If you use default this one is not needed.> encoding: UTF8 > min_messages: warningregards Claus
Thanks very much Claus, I discovered my error soon after I sent the "help me" email, but am grateful for your quick response anyway. Thanks again, Bealach>From: "Claus Guttesen" <kometen@gmail.com> >Reply-To: rails@lists.rubyonrails.org >To: rails@lists.rubyonrails.org >Subject: Re: [Rails] Postgresql connection problems >Date: Thu, 23 Mar 2006 13:39:04 +0100 > > > I''m trying to connect to a postgresql server: > > > > My database.yml contains: > > > > test_test: > >Replace test_test with either development, test or production. > > > adapter: postgresql > > database: test_test > > username: testuser > > password: resutest > > host: testpgserver > > port: 5432 > >If you use default this one is not needed. > > > encoding: UTF8 > > min_messages: warning > >regards >Claus >_______________________________________________ >Rails mailing list >Rails@lists.rubyonrails.org >http://lists.rubyonrails.org/mailman/listinfo/rails
Claus Guttesen wrote:>>I''m trying to connect to a postgresql server: >> >>My database.yml contains: >> >>test_test: > > > Replace test_test with either development, test or production. > > >> adapter: postgresql >> database: test_test >> username: testuser >> password: resutest >> host: testpgserver >> port: 5432 > > > If you use default this one is not needed. > > >> encoding: UTF8 >> min_messages: warning > > > regards > Claus >Can you connect to the same database via psql?
Claus Guttesen wrote:>>I''m trying to connect to a postgresql server: >> >>My database.yml contains: >> >>test_test: > > > Replace test_test with either development, test or production. > > >> adapter: postgresql >> database: test_test >> username: testuser >> password: resutest >> host: testpgserver >> port: 5432 > > > If you use default this one is not needed. > > >> encoding: UTF8 >> min_messages: warning > > > regards > Claus >Can you connect to the same database via psql?