简体   繁体   中英

Heroku assets precompile error, despite compiling assets locally

I am currently first time deploying my app to Heroku, and am encountering the precompile error. When I execute the command git push heroku master , I get:

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?

After a bit of searching, I encountered both Heroku's own troubleshooting guide on precompile error, as well as this post on precompile errors and Rails 3.2, and following their directions, did the following:

  1. Added config.assets.initialize_on_precompile = false to my application.rb file
  2. Made a new heroku app using heroku create just to be safe
  3. Per the Rails guide , ran bundle exec rake assets:precompile

I thought that since I am doing the compiling locally , when pushing to Heroku it would just skip the compilation part based on detecting a manifest.yml file. However, even when I do so, when running git push heroku master , it will still run rake assets:precompile and generate the same error as seen above.

Thanks in advance for you help!

Addendum

In my .gitignore, I have the following:

# Ignore bundler config
/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3

# Ignore all logfiles and tempfiles.
/log/*.log
/tmp

At first glance, I would assume that it should work.

Can you confirm that you have committed and merged all changes into master? ie git status

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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