I have 'pg' gem installed
my database.yml looks like this
development:
adapter: postgresql
encoding: unicode
database: test
pool: 5
username:
password:
however i am getting the following migrate error
yadav@expression:$ rake db:migrate --trace
(in /home/yadav/dev/rails/tmp/testapp)
** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
rake aborted!
could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.
5432"?
--
Kind Regards,
Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely
GNU/Linux: 2.6.35-22-generic
Kubuntu x86_64 10.10 | KDE 4.5.1
Ruby 1.9.2p0 | Rails 3.0.1
Is the server running locally and accepting connections on that unix domain socket? You don't say that it is...
Or if you don't want to tweak that, change your database.yml and add a "host: localhost" entry.
-philip
--
Kind Regards,
Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely
GNU/Linux: 2.6.35-22-generic
Kubuntu x86_64 10.10 | KDE 4.5.1
Ruby 1.9.2p0 | Rails 3.0.1
--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonra...@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-ta...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Hi Philip,
that was it, not sure (yet) how to setup the server to listen on the
unix domain socket, but adding the host entry made the connection
possible.
I can now add and view records interactively from the rails console!
Thanks,
Hi David,
thanks for the tip, I got it working, just had to add "host:
localhost" as Philip pointed out.
Kind Regards,
Rajinder Yadav
Kind Regards,
Rajinder Yadav
Hi David,
'rails dbconsole' works for me. Are you on Linux? if so what do you get
when you do a 'which psql', do you get the right path?
I built postgresql-9.0.1 from source, and the make install script puts
psql under /usr/local/pgsql/bin/psql
What I ended up doing instead of adding to the $PATH, was creating a
symbolic link under /usr/local/bin
lrwxrwxrwx 1 root root 25 2010-12-07 19:50 psql ->
/usr/local/pgsql/bin/psql
I am guessing, either you need to update your $PATH variable or use a
sym-link like me and things should work fine.
I built postgresql-9.0.1 from source, and the make install script puts psql under /usr/local/pgsql/bin/psql
What I ended up doing instead of adding to the $PATH, was creating a symbolic link under /usr/local/bin
lrwxrwxrwx 1 root root 25 2010-12-07 19:50 psql -> /usr/local/pgsql/bin/psql
I am guessing, either you need to update your $PATH variable or use a sym-link like me and things should work fine.
--
Kind Regards,
Rajinder Yadav | DevMentor.org | Do Good! ~ Share Freely
GNU/Linux: 2.6.35-22-generic
Kubuntu x86_64 10.10 | KDE 4.5.1
Ruby 1.9.2p0 | Rails 3.0.1
--
It is looking for the domain socket in
/var/run/postgresql/.s.PGSQL.5432.
Go in /var/run/postgresql/ and
ln -s wherever/your/domain/socket/is/.s.PGSQL.5432 .
You can find the socket with a global search, like
find / -name .s.PGSQL.\*
The above will fix the issue, but a more definitive solution would be to
point rails to the right location of the domain socket (I am just
looking how to do it myself!)
--
Posted via http://www.ruby-forum.com/.
The fact that use use localhost to connect to the local machine is irrelevant you can put any IP address there to connect to a PostgreSQL instance anywhere on the Internet