Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

rake aborted! PG::ConnectionBad: fe_sendauth: no password supplied Tasks: TOP => db:migrate (See full trace by running task with --trace)

I get the following when trying a rake db:migrate

rake aborted!
PG::ConnectionBad: fe_sendauth: no password supplied

Tasks: TOP => db:migrate
(See full trace by running task with --trace)

I also get a similar message when going to my localhost

fe_sendauth: no password supplied

My rails server and rails console won't work either

I've been trying a few things and this is what my gemfile currently looks like:

source 'https://rubygems.org'
ruby '2.0.0'

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.0.3'

# Use SCSS for stylesheets
gem 'sass-rails', '~> 4.0.0'

# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'

# Use CoffeeScript for .js.coffee assets and views
gem 'coffee-rails', '~> 4.0.0'

# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby

# Use jquery as the JavaScript library
gem 'jquery-rails'

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'turbolinks'

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 1.2'
gem 'devise'


gem 'pg'

group :doc do
  # bundle exec rake doc:rails generates the API under doc/api.
  gem 'sdoc', require: false
end


group :production do
  gem 'rails_12factor'
end

and my database.yml

development:
  adapter: postgresql
  encoding: unicode
  database: myapp_development
  pool: 5
  username: myapp
  password:

test:
  adapter: postgresql
  encoding: unicode
  database: myapp_test
  pool: 5
  username: myapp
  password:

production:
  adapter: postgresql
  encoding: unicode
  database: myapp_production
  pool: 5
  username: myapp
  password:

What is the problem? It seems that to access my postgres table locally I need some sort of password? My app works fine when it is run through Heroku. So I am just doing Heroku open and I can submit new links and posts as my app is intended but it won't work locally.

like image 832
user3408293 Avatar asked Mar 28 '14 04:03

user3408293


2 Answers

For your local machine, under the test and development sections in database.yml you should change username to your logged in username. The rails generator makes it the same as the app name - this will not work. For production it does not matter as it is run on Heroku and they change that setting automatically when you deploy.

like image 120
andreofthecape Avatar answered Nov 18 '22 21:11

andreofthecape


You should have values for username and password according to any of the existing ones. You can check your users with psql -d postgres and then \du

like image 1
Ed_ Avatar answered Nov 18 '22 20:11

Ed_