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!