URI::InvalidURIError PostgreSQL Rails 3.2.3

1.7k Views Asked by At

Having an Issue. Running PostgreSQL,Rails 3.2.3 , Ruby 1.9.2p180 and 1.9.3(via Pik) on Windows 7 . When i try to Do

heroku db:push 

on ruby 1.9.2, i get an Error

Loaded Taps v0.3.23
Auto-detected local database: postgres://postgres:lalala@localhost/prelaunch_d
evelopment
# Connect on a TCP socket. Omitted by default since the client uses a?encoding=u
tf8
.....
Failed to connect to database:
URI::InvalidURIError -> bad URI(is not URI?): postgres://postgres:lalala@loc
alhost/prelaunch_development
# Connect on a TCP socket. Omitted by default since the client uses a?encoding=u
tf8

What might i be doing wrong please?

2

There are 2 best solutions below

0
On BEST ANSWER

Turns out the issue was with my database.yml file, Was using this, and it had issues. Switching to this solved the Issue

0
On

If your working on your local machine try something like this.

login: &login
  adapter: postgresql
  host: localhost
  username: postgres
  password: yourpassword!
  pool: 5
  encoding: unicode


development:
    database: dbname
    <<: *login

test:
   database: dbname
   <<: *login

production:
  database: dbname
  <<: *login

Note that host:localhost was added because the default file doesn't have that.