Marcin Doliwa
Marcin Doliwa

Reputation: 3659

My app assets are working only after one more push to heroku

I have simple Rails4 app on heroku.

I do some changes in assets like adding image or changing css file. Run git push heroku master - it's updated with all changes except assets changes.

Now when I add new commit and push it to heroku, then assets changes from previous commit finally are working.

Any idea why?

Upvotes: 0

Views: 35

Answers (3)

Elvn
Elvn

Reputation: 3057

This is possibly caused by the sequence of git commands. Make sure you do the assets precompile before your git add so your updated assets are added to the committed change and then pushed.

$bundle exec rake assets:precompile RAILS_ENV=production 
$git add -A
$git commit -m "Important update"
$git merge branch_name ....
$git heroku push master

Upvotes: 0

Andrey Deineko
Andrey Deineko

Reputation: 52357

  1. Take a look into what Heroku thinks about assets:

    assets pipeline on Heroku for rails

    assets pipeline on Heroku for rails 4

  2. There is always an option to precompile assets manually:

    RAILS_ENV=production bundle exec rake assets:precompile

Upvotes: 2

JSBach
JSBach

Reputation: 4747

I am not sure, but I had a similar issue. precompile your assets before pushing:

rake assets:precompile

This might do the trick

Upvotes: 0

Related Questions