【发布时间】:2012-05-04 10:27:55
【问题描述】:
我在 Rails 3.2.2 上运行并部署在 Cedar 堆栈上。我仍然收到以下错误:
-----> 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?
即使guide 建议将config.assets.initialize_on_precompile 设置为false,但提到:
确保在部署前测试 rake assets:precompile 在本地。它 可能会暴露您的资产引用应用程序对象或 方法,因为这些仍然在开发模式的范围内 这个标志的值。
像one 这样的一些文章建议使用Heroku labs。但即便如此,它也有其自身的含义,因为它仍处于测试阶段。
我已经阅读了其他几个在线资源,包括:
Rails 3.1 assets:precompile Connecting to Database
rake assets:precompile not working on heroku
都有不同的解决方案。那么避免这个错误的正确方法是什么?有人在 Heroku 实验室遇到过什么大问题吗?有更好的方法吗?
附言。只是要清楚。在本地运行 rake assets:precompile RAILS_ENV=development 或 rake assets:precompile RAILS_ENV=production 是否正确?
【问题讨论】:
-
错误日志是否告诉您一些有用的信息?
-
这表明正在查看devcenter.heroku.com/articles/… 我已经阅读了有关在链接上应用解决方案的混合结果
标签: ruby-on-rails ruby-on-rails-3 heroku asset-pipeline