Studying at http://ruby.railstutorial.org/ version 3.2
Stucked in the end of 6.2.1 section with the following:
$ bundle exec rake db:test:prepare
rake aborted!
FATAL: no pg_hba.conf entry for host "192.168.108.1", user "sample_user", database "postgres", SSL on
FATAL: no pg_hba.conf entry for host "192.168.108.1", user "sample_user", database "postgres", SSL off
Tasks: TOP => db:test:load => db:test:purge
192.168.108.1 is my ip. Why is it looking for it, if I have another entry in database.yml? User sample_user is owner of all databases and has CREATEDB on them. I can successfuly connect to any database on 192.168.108.2 with psql from 192.168.108.1
How cat I overcome it, still using remote postgres?
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.3'
gem 'bootstrap-sass', '2.0.0'
gem 'pg', '0.12.2'
group :development, :test do
gem 'rspec-rails', '2.9.0'
end
group :assets do
gem 'sass-rails', '3.2.4'
gem 'coffee-rails', '3.2.2'
gem 'uglifier', '1.2.3'
end
gem 'jquery-rails', '2.0.0'
group :development do
gem 'annotate', '~> 2.4.1.beta'
end
group :test do
gem 'capybara', '1.1.2'
gem 'spork', '0.9.0'
end
database.yml
common: &common
adapter: postgresql
username: sample_user
password: qwerty123
host: 192.168.108.2
development:
<<: *common
database: sample_db_dev
test:
<<: *common
database: sample_db_tst
production:
<<: *common
database: sample_db_pro
pg_hba.conf on 192.168.108.2
host sample_db_dev sample_user 192.168.108.1/32 md5
host sample_db_tst sample_user 192.168.108.1/32 md5
host sample_db_pro sample_user 192.168.108.1/32 md5
have no local pg_hba.conf on 192.168.108.1
ruby 1.9.3p125 Rails 3.2.3 psql (PostgreSQL) 8.4.11