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

时间:2013-02-05 17:23:10

标签: ruby-on-rails ruby-on-rails-3 deployment heroku

我目前第一次将我的应用程序部署到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,在预编译错误和Rails 3.2上遇到了这个post,并按照他们的指示,做了以下事情:

  1. config.assets.initialize_on_precompile = false添加到我的application.rb文件
  2. 使用heroku create创建一个新的heroku应用程序只是为了安全
  3. 根据Rails guide,运行bundle exec rake assets:precompile
  4. 我认为,因为我正在编译本地,所以当推送到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
    

1 个答案:

答案 0 :(得分:1)

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

您能否确认已将所有更改提交并合并到母版?即git status

相关问题