我正在尝试将一个简单的Sinatra应用程序部署到Heroku,我正在使用postgresql,我的Gemfile看起来像这样:
gem 'sinatra'
gem 'data_mapper'
gem 'dm-postgres-adapter'
gem 'pg'
gem 'database_cleaner'
gem 'bcrypt-ruby'
gem 'rack-flash3'
gem 'sinatra-partial'
gem 'mandrill-api'
group :development, :test do
gem 'capybara'
gem 'shotgun'
gem 'rspec'
gem 'debugger'
end
我的app上有pg插件,这就是我的datamapper_setup.rb的样子:
env = ENV['RACK_ENV'] || "development"
DataMapper.setup(:default, ENV['DATABASE_URL'] || "postgres://localhost/bookmark_manager_# {env}")
DataMapper.finalize
DataMapper.auto_upgrade!
我不知道如何解释来自heroku的日志,但这里是:
2014-03-29T13:35:47.674101+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=staging-bookmarkmanager.herokuapp.com request_id=304ebd75-859f-4768-9766-f25ca2fdf3ba fwd="77.99.158.5" dyno= connect= service= status=503 bytes=
2014-03-29T13:35:48.545822+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=staging-bookmarkmanager.herokuapp.com request_id=1669c22c-60c2-4d74-9967-7e60b32d49ad fwd="77.99.158.5" dyno= connect= service= status=503 bytes=
2014-03-29T13:35:51.486444+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/ host=staging-bookmarkmanager.herokuapp.com request_id=6c70962d-7313-4dee-82de-5c12ca091aab fwd="77.99.158.5" dyno= connect= service= status=503 bytes=
2014-03-29T13:35:52.025452+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path=/favicon.ico host=staging-bookmarkmanager.herokuapp.com request_id=9166bd84-2187-4d2c-bf01-13a1a5574ac1 fwd="77.99.158.5" dyno= connect= service= status=503 bytes=
关于为什么会发生这种情况的任何想法?我已经尝试了几种没有运气的方法。
答案 0 :(得分:0)
在您发布的其他日志中,似乎数据库拒绝您的连接:
FATAL: role "xbwj…jedif" is not permitted to log in (DataObjects::ConnectionError)
确认ENV['DATABASE_URL']
提供的凭据与heroku config
的输出中列出的凭据相同。