Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/xslt/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 正在连接到由数据库\u URL指定的数据库_Ruby On Rails_Heroku_Heroku Postgres - Fatal编程技术网

Ruby on rails 正在连接到由数据库\u URL指定的数据库

Ruby on rails 正在连接到由数据库\u URL指定的数据库,ruby-on-rails,heroku,heroku-postgres,Ruby On Rails,Heroku,Heroku Postgres,我一直在heroku日志中看到: 14-10-30T12:59:51+00:00 heroku[slug-compiler]: Slug compilation finished 2014-10-30T12:59:51.608050+00:00 heroku[web.1]: State changed from crashed to starting 2014-10-30T13:00:00.705131+00:00 heroku[web.1]: Starting process with com

我一直在heroku日志中看到:

14-10-30T12:59:51+00:00 heroku[slug-compiler]: Slug compilation finished
2014-10-30T12:59:51.608050+00:00 heroku[web.1]: State changed from crashed to starting
2014-10-30T13:00:00.705131+00:00 heroku[web.1]: Starting process with command `bundle exec unicorn -p 35211 -c ./co
nfig/unicorn.rb`
2014-10-30T13:00:03.661476+00:00 app[web.1]: I, [2014-10-30T13:00:03.661285 #2]  INFO -- : Refreshing Gem list
2014-10-30T13:00:15.728226+00:00 app[web.1]: Connecting to database specified by DATABASE_URL
2014-10-30T13:00:21.655877+00:00 heroku[web.1]: State changed from starting to crashed
在谷歌上查了几乎所有的答案

db:安装成功了

db:迁移成功了

config.assets.initialize\u on\u precompile=false已设置

不仅是heroku,我在本地生产环境中也遇到了同样的错误:

Macs-MacBook-Pro:v1 mac$ RAILS_ENV=production rails s
=> Booting WEBrick
=> Rails 3.2.13 application starting in production on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
Connecting to database specified by database.yml
Exiting
这是database.yml

production:
  adapter: postgresql
  host: 127.0.0.1
  port: 5432
  encoding: unicode
  database: s1_development
  pool: 5
  username: postgres
  password: password
本地开发环境没有任何问题:(


我还能做什么?或者如何找到问题?

数据库URL是否设置为有效的数据库?例如,“psql”工作吗?是的,数据库已创建、迁移并且应该工作