耙子中止了! PG :: ConnectionBad:fe_sendauth:不提供密码任务:TOP => db:migrate(通过使用--trace运行任务来查看完整跟踪) [英] rake aborted! PG::ConnectionBad: fe_sendauth: no password supplied Tasks: TOP => db:migrate (See full trace by running task with --trace)

查看:810
本文介绍了耙子中止了! PG :: ConnectionBad:fe_sendauth:不提供密码任务:TOP => db:migrate(通过使用--trace运行任务来查看完整跟踪)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当尝试 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

我的Rails服务器和Rails控制台也不能使用

My rails server and rails console won't work either

我一直在尝试一些这是我的gemfile目前的样子:

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

和我的database.yml

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:

有什么问题?似乎要在本地访问我的postgres表,我需要某种密码?当它通过Heroku运行时,我的应用程序工作正常。所以我只是打开Heroku,我可以提交新的链接和帖子作为我的应用程序的预期,但它不会在本地工作。

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.

推荐答案

对于您的本地机器,在 test development 部分在 database.yml 中,您应该将 username 更改为登录用户名。导轨生成器使其与应用程序名称相同 - 这不起作用。对于生产而言,它并不重要,因为它在Heroku上运行,并且在部署时会自动更改该设置。

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.

这篇关于耙子中止了! PG :: ConnectionBad:fe_sendauth:不提供密码任务:TOP => db:migrate(通过使用--trace运行任务来查看完整跟踪)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆