部署 Heroku 发布项目折腾了好久

suxu · 2013年09月02日 · 最后由 suxu 回复于 2013年09月02日 · 2536 次阅读

哎,标记一下这个,折腾了好久,之前都是成功的。

Cleaning up the bundler cache.
-----> Writing config/database.yml to read from DATABASE_URL
-----> Preparing app for Rails asset pipeline
       Running: rake assets:precompile
       rake aborted!
       could not connect to server: Connection refused
       Is the server running on host "127.0.0.1" and accepting
       TCP/IP connections on port 5432?
       /tmp/build_10n0v7mu24y0j/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `initialize'
       /tmp/build_10n0v7mu24y0j/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.0/lib/active_record/connection_adapters/postgresql_adapter.rb:825:in `new'

ruby 2.0 rails 4.0

从错误提示上看,本地 postgresql 数据库没有跑起来,或者没有?

#1 楼 @lgn21st 哎,害我好苦啊。我把 acts-as-taggable-on 从 Gemfile 中去掉就对了。 分析原因:用 heroku 发布,在编译资源的时候,是可以没有数据库的。而 acts-as-taggable-on 则需要连接到真正的数据库创建 taggings table;

https://devcenter.heroku.com/articles/rails-asset-pipeline

需要 登录 后方可回复, 如果你还没有账号请 注册新账号