I'm experimenting with ActiveRecord with Ruby -- no Rails. I installed both
the Mysql and Postgres (the C one, not the fully Ruby one) database dependent
drivers. I can use them to manipulate their databases, respectively. I
installed DBI, and can get it to manipulate both the MySQL and the Postgres
database, and except for a couple things, do it in a database independent
I installed ActiveRecord (via an old Rails install), and can get it to
interact with the MySQL database. However, when I try to get it to interact
with the Postgres database, I get the following error:
[slitt@mydesk ~]$ ./test2.rb
`establish_connection': database configuration specifies nonexistent pg
I'll leave my code at the bottom of this email. When I comment out
the :adapter =>"pg" statement, it works perfectly with MySQL. But when I
instead comment out the :adapter =>"mysql" statement, it errors out as
What steps should I take to identify the cause of this problem?
# :adapter => "mysql",
:adapter => "pg", # adapter not found error, investigate
:database => "test",
:user => "myid"
class Rock < ActiveRecord::Base
newrow = Rock.new
newrow.rockname = "Bassalt"
puts "Now let's see them all!"
whatever = Rock.find(:all)
whatever.each do |row|
print row.id, " ", row.rockname, "\n"
Rock.delete_all("rockname = 'Bassalt'")