# Anchor
click_link 'Save'
# Button
click_button 'awesome'
# Both above
I believe Ubuntu 16.04 comes with PostgreSQL 9.5. Thats good for a start, but it is a matter of time before you have the need of a PostgreSQL 9.6 cluster. For me it was to import a PG backup from Heroku.
The procedure couldn't have been any easier and is described below. If you are interested in upgrading your old cluster to 9.6 afterwards, you may be interested in this.
The connection failed because by default psql
connects over UNIX sockets using peer
authentication, that requires the current UNIX user to have the same user name as psql
. So you will have to create the UNIX user postgres
and then login as postgres
or use sudo -u postgres psql database-name
for accessing the database (and psql
should not ask for a password).
If you cannot or do not want to create the UNIX user, like if you just want to connect to your database for ad hoc queries, forcing a socket connection using psql --host=localhost --dbname=database-name --username=postgres
(as pointed out by @meyerson answer) will solve your immediate problem.
But if you intend to force password authentication over Unix sockets instead of the peer method, try changing the following pg_hba.conf
* line:
from
package main | |
import ( | |
"fmt" | |
"io" | |
"os" | |
) | |
var path = "/Users/novalagung/Documents/temp/test.txt" |
# Ubuntu 14.04 repo | |
# For more repos see https://www.ubuntuupdates.org/ppa/postgresql?dist=trusty-pgdg | |
# Install key | |
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add - | |
# 14.04 repo | |
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list' | |
apt update |
feature 'Enrolment' do | |
scenario 'Enrolling in a course' do | |
given_there_is_a_course | |
and_i_am_logged_in_as_a_learner | |
when_i_enrol_on_a_course | |
then_the_course_should_appear_in_my_courses | |
end | |
def given_there_is_a_course | |
@course = FactoryGirl.create(:course) |