Comments on How to Install Ruby on Rails (RoR) with PostgreSQL on Ubuntu 16.04
In this tutorial, I will show you how to install Ruby on Rails on ubuntu 16.04 LTS. I will show you how to install and configure Rails with a PostgreSQL database, and how to create a new first project with Rails. Ruby on Rails (RoR) is an open source web application framework, published under MIT License. Ruby on Rails, or rails is written in Ruby, it is a server-side web application framework that follows the MVC (Model-View-Controller) concept.
7 Comment(s)
Comments
This was exactly what I was looking for!
What I found however was that I needed to modify the pg_hba.conf file located at /etc/postgresql/<version>/pg_hba.conf to something like:
local all all trust host all all 127.0.0.1/32 trust host all all ::1/128 trustand then restart Postgresql with:
$ /etc/init.d/postgresql restart
How well does this work with Windows 10 and the WSL Ubuntu 16.04 system?
I have got that error for past 2 days and I can't move on, please help.
FATAL: Ident authentication failed for user "rails_dev"
Couldn't create database for {"adapter"=>"postgresql", "encoding"=>"unicode", "pool"=>5, "database"=>"myapp_test", "username"=>"rails_dev", "password"=>"aqwe123", "host"=>"localhost", "port"=>5432}
rails aborted!
PG::ConnectionBad: FATAL: Ident authentication failed for user "rails_dev"
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in `initialize'
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in `new'
/home/whitehat/.rvm/gems/ruby-2.4.0/gems/pg-0.21.0/lib/pg.rb:56:in `connect'
I have seen the step to type su - postgres on many different blog posts. It always asks me for a password, and no passwords I can find or think of ever work. I've searched for a default postgres user password with no luck. Am I missing something?
If your root user has no password, try:
sudo su - postgres
instead.
Super helpful. Esp. part about Postgres. Thx!
For Debian Stretch 9 Users, install:
$ sudo apt install libpq-dev
$ gem install pg -v '1.1.4' --source 'https://rubygems.org/'
The last one if taking from an error.