Hi guys,
I need your help. Here is my database.yml:
development:
adapter: postgresql
database: db
username: username
password: mypassword
Connect on a TCP socket. Omitted by default since the client uses a
domain socket that doesn’t need configuration. Windows does not
have
domain sockets, so uncomment these lines.
host: 192.168.22.1 (this is a remote ip in local loop)
port: 5432
Yes, I commented out everything else. Whenever I make a script/generate
scaffold service_spiel, this is what I get:
exists app/controllers/
exists app/helpers/
exists app/views/service_spiels
exists test/functional/
dependency model
exists app/models/
exists test/unit/
exists test/fixtures/
identical app/models/service_spiel.rb
identical test/unit/service_spiel_test.rb
identical test/fixtures/service_spiels.yml
error Before updating scaffolding from new DB schema, try
creating a table for your model (ServiceSpiel)
My table in 192.168.22.1 is here:
\d service_spiels
View “service_spiels”
Column | Type | Modifiers
---------±-----------------------±----------
id | integer |
service | character varying(20) |
spiel | character varying(550) |
View definition: SELECT service_spiel.id, service_spiel.service,
service_spiel.spiel FROM service_spiel;
I tried out Kevin Jorgensen’s suggestion of using migrate and this is
what I get:
rake migrate
(in /home/nsadmin/brewedpages)
== Servicespiels: migrating
– create_table(:service_spiels)
NOTICE: CREATE TABLE will create implicit sequence
‘service_spiels_id_seq’ for SERIAL column ‘service_spiels.id’
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
‘service_spiels_pkey’ for table ‘service_spiels’
-> 0.1989s
== Service_spiels: migrated (0.1991s)
rake aborted!
PGError: ERROR: Option ‘search_path’ is not recognized
: SHOW search_path
Yes it pops with this error but the table was SUCCESSFULLY created! The
search_path in my database.yml is commented out.
Also, I tried one of the suggestions here at the forum of hardcoding my
connection in my models:
class ServiceSpiels < ActiveRecord::Base
unless connected?
establish_connection(
:adapter => “postgresql”,
:database => “db”,
:host => “192.168.22.1”,
:port => “5432”,
:username => “username”,
:password => “mypassword”
)
end
end
but it pops with this fault: Recognition failed “/service_spiels/”
This is driving me crazy! Please help!
bing