0

I've moved my development environment from sqlite to postgresql on Cloud9 IDE, following this post Cloud9 postgres.

Now just about everything works,

  • created a new db
  • migrated table changes
  • saved data to db with rake tasks
  • rendered data from the db in views

But when I run rails c and try and load data there, it fails.

Item

=> Item (call 'Item.connection' to establish a connection)

Item.all

=> PG::ConnectionBad: fe_sendauth: no password supplied

I don't think its actually a no password issue because in every other way I can access and work with the database... just not in rails console.

Does maybe something need to be done to setup a new connection here?

Community
  • 1
  • 1
tim_xyz
  • 11,573
  • 17
  • 52
  • 97

1 Answers1

0

the main issue is POSTGRES need a role to be setup , no doubt the app must be working fine, but when u type in rails c , the control access the schema file and tries to load all the table, here the table ITEM must be the first one to be read by control. all you need to do is create a role in postgres as superuser and type in its credentials in database.yml.

let me know if this works

Apoorv
  • 1,338
  • 1
  • 17
  • 18
  • Thanks for the idea, but I think i've already created a user with `postgres=# CREATE USER username SUPERUSER PASSWORD 'password';`. Is there something else that can be tried? – tim_xyz May 21 '16 at 17:02