I am trying to switch my very first Rails app from sqlite to PostgreSQL. I am using a Nitrous box for development and when I tried to switch to Postgre and deploy to Heroku it didn't work so now I'm just trying to use Postgre on Nitrous. I am using Rails 4.1.6.
First I followed these steps:
https://devcenter.heroku.com/articles/getting-started-with-rails4#use-postgres
But I was getting an error saying "psql: could not connect to server: No such file or directory" so I installed psql by following steps no. 4 and 5 from this:
https://gist.github.com/afshinator/8035821
In particular I ran "parts install postgresql" and "parts start postgresql" on my Nitrous box. The postgres version is 9.2.4.
And I also added a line into my database.yml file of "host: localhost" so it now looks like:
default: &default
adapter: postgresql
host: localhost
pool: 5
timeout: 5000
development:
<<: *default
database: db/db_development
...
And my Gemfile includes:
gem 'pg'
My table is called "movies" and if I type "psql db/db_development" and then "select * from movies;" I can see a table. But I can't access this from the Rails console with Active Record.