Skip to content

Instantly share code, notes, and snippets.

@bobbyno
Last active December 12, 2015 02:28
Show Gist options
  • Save bobbyno/4698471 to your computer and use it in GitHub Desktop.
Save bobbyno/4698471 to your computer and use it in GitHub Desktop.
Workarounds for compilation errors in the Heroku asset pipeline
#!/usr/bin/env bash
printf "Precompiling assets..."
rake assets:precompile
printf "\nCommitting assets to git..."
git add public/assets/
git commit -am "Update asset pipeline"
printf "\nDeploying to Heroku..."
git push heroku
printf "\nRemoving assets..."
rm -rf public/assets
git commit -am "Remove asset pipeline..."
printf "\nPushing changes..."
git push origin
printf "\n"
@bobbyno
Copy link
Author

bobbyno commented Feb 2, 2013

Or you can do this:

# https://devcenter.heroku.com/articles/rails3x-asset-pipeline-cedar#troubleshooting
# While precompiling assets, in Rails 3.1.1 and up, you can prevent initializing your 
# application and connecting to the database by ensuring that the following line is in 
# your config/application.rb:
config.assets.initialize_on_precompile = false   

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment