【发布时间】:2013-01-20 17:14:24
【问题描述】:
我目前是第一次将我的应用程序部署到 Heroku,并且遇到了预编译错误。当我执行命令git push heroku master 时,我得到:
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?
经过一番搜索,我遇到了 Heroku 自己的 troubleshooting guide 预编译错误,以及这个 post 预编译错误和 Rails 3.2,并按照他们的指示执行了以下操作:
- 已将
config.assets.initialize_on_precompile = false添加到我的application.rb文件中 - 为了安全起见,使用
heroku create制作了一个新的 heroku 应用程序 - 根据Rails guide,运行
bundle exec rake assets:precompile
我认为由于我是在本地进行编译,所以当推送到 Heroku 时,它会根据检测到 manifest.yml 文件跳过编译部分。但是,即使我这样做了,在运行 git push heroku master 时,它仍然会运行 rake assets:precompile 并生成与上面相同的错误。
提前感谢您的帮助!
附录
在我的 .gitignore 中,我有以下内容:
# Ignore bundler config
/.bundle
# Ignore the default SQLite database.
/db/*.sqlite3
# Ignore all logfiles and tempfiles.
/log/*.log
/tmp
【问题讨论】:
标签: ruby-on-rails ruby-on-rails-3 deployment heroku