0
votes

Yeah, I know it was asked a lot of times, and still I can't find right answer. So settings is:

1)I'm running server on Ubuntu 14, console info:

...
* Environment: development
* Listening on tcp://localhost:3000

So env is development

2) database.yml:

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5

development:
  <<: *default
  database: dbmane
  username: developer_dbmane
  PASSWORD: some_pass
  HOST: xxx.xxx.xxx.128
  port: 5432

3) http://localhost:3000/ reports:

"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"?"

...

@config

{:adapter=>"postgresql", :encoding=>"unicode", :pool=>5, :database=>"dbname", :username=>"developer_dbname", :PASSWORD=>"some_pass", :HOST=>"xxx.xxx.xxx.128", :port=>5432}

@connection_parameters

{:port=>5432, :user=>"developer_i18n", :dbname=>"i18n"}

4) I CAN connect remote DB with command:

psql -hxxx.xxx.xxx.128 -Udeveloper_dbname dbname

Authorization is fine too - so remote server DO acccept remote connections

5) Local postgress server is shuted down, but if it not: Ruby server trying to connect to it.

So the question is how to configure it to connect remote, not local server after all?

1
Can you try to use host: xxx.xxx.xxx.128 instead of HOST: xxx.xxx.xxx.128?IngoAlbers

1 Answers

2
votes

Yaml is case-sensitive, so the problem is probably that it doesn't recoginze the host and password settings.

Try to use this:

default: &default
  adapter: postgresql
  encoding: unicode
  pool: 5

development:
  <<: *default
  database: dbmane
  username: developer_dbmane
  password: some_pass
  host: xxx.xxx.xxx.128
  port: 5432