2014-03-28 51 views
0

我剛剛安裝了heroku,然後是postgresql,但現在出現此錯誤。爲什麼我需要密碼?我的密碼是什麼?fe_sendauth:本地主機上沒有提供密碼:300

我在幾個小時花在尋找一些工作,但不能得到任何工作(我在Windows上):

這是我的database.yml

# SQLite version 3.x 
# gem install sqlite3 
# 
# Ensure the SQLite 3 gem is defined in your Gemfile 
# gem 'sqlite3' 
development: 
    adapter: postgresql 
    encoding: unicode 
    database: myapp_development 
    pool: 5 
    username: postgresql 
    password: 
    host: localhost 

# Warning: The database defined as "test" will be erased and 
# re-generated from your development database when you run "rake". 
# Do not set this db to the same as development or production. 
test: 
    adapter: postgresql 
    encoding: unicode 
    database: myapp_test 
    pool: 5 
    username: postgresql 
    password: 
    host: localhost 

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

這是我的寶石文件

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 
# Use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.1.2' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Use Capistrano for deployment 
# gem 'capistrano', group: :development 

# Use debugger 
# gem 'debugger', group: [:development, :test] 

任何想法,我可以做什麼?

回答

0

database.yml文件的testdevelopment部分的本地機器上,您應該將username更改爲您登錄的用戶名。導軌生成器使其與您的應用程序名稱相同,並且不起作用。在生產中,您部署到heroku並且設置會自動更改並不重要。

0

this page,你可以使用這個命令:

$ heroku config | grep HEROKU_POSTGRESQL 
HEROKU_POSTGRESQL_RED_URL: postgres://user3123:[email protected]:6212/db982398 

給出的網址是postgresql connection字符串包含嵌入它(user3123和passkja83kd8在這個例子中)的用戶名和密碼。

+0

對不起,我不明白。我還應該使用user3123和passkja83kd8還是使用不同的。我的用戶名和密碼是什麼,或者我想找什麼地方?我在軌道上很新,所以從來沒有這樣做過。 – user3408293

+0

@ user3408293我建議你閱讀我鏈接的頁面 - 有關postgresql的heroku文檔。如果你在heroku中建立了一個數據庫,那麼heroku應該能夠告訴你它設置的密碼。命令'heroku config'似乎是這樣做的(儘管注意我對heroku一無所知,所以我只是在記錄下的heroku幫助)。 – harmic

相關問題