繁体   English   中英

尽管在本地编译资产,但Heroku资产预编译错误

[英]Heroku assets precompile error, despite compiling assets locally

我目前是第一次将应用程序部署到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自己的关于预编译错误的疑难解答指南 ,以及有关预编译错误和Rails 3.2的帖子 ,并按照它们的指示进行了以下操作:

  1. 向我的application.rb文件添加了config.assets.initialize_on_precompile = false
  2. 为了安全起见,使用heroku create制作了一个新的heroku应用程序
  3. 根据Rails指南 ,运行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

乍一看,我认为它应该起作用。

您可以确认已提交所有更改并将其合并到master中吗? git status

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM