Skip to content

Commit

Permalink
Add Heroku nodejs buildpack to app.json
Browse files Browse the repository at this point in the history
**Why**: After upgrading to the latest webpacker, assets failed to
compile on Heroku. This issue says you need to add the nodejs buildpack:
rails/webpacker#739

Make sure the nodejs buildpack comes before the ruby one.
For existing apps, this can be done like so:
heroku buildpacks:add heroku/nodejs -i 1 -a your_app_name

I also removed unnecessary items from app.json.
  • Loading branch information
monfresh committed Apr 4, 2018
1 parent 093dd8d commit 84d7d60
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
18 changes: 3 additions & 15 deletions app.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@
"GOOGLE_ANALYTICS_ID": {
"required": true
},
"HEROKU_POSTGRESQL_RED_URL": {
"required": true
},
"LANG": {
"required": true
},
Expand All @@ -42,15 +39,6 @@
"MEMCACHIER_USERNAME": {
"required": true
},
"NEW_RELIC_APP_NAME": {
"required": true
},
"NEW_RELIC_LICENSE_KEY": {
"required": true
},
"NEW_RELIC_LOG": {
"required": true
},
"OHANA_API_ENDPOINT": {
"required": true
},
Expand Down Expand Up @@ -83,13 +71,13 @@
}
},
"addons": [
"logentries",
"newrelic",
"memcachier",
"heroku-postgresql",
"sendgrid"
],
"buildpacks": [
{
"url": "heroku/nodejs"
},
{
"url": "heroku/ruby"
}
Expand Down
3 changes: 3 additions & 0 deletions script/setup_heroku
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ heroku addons:create sendgrid:starter --app $APP_NAME
echo "Installing Memcachier"
heroku addons:create memcachier --app $APP_NAME

echo "Adding NodeJS buildback for compatibility with webpacker"
heroku buildpacks:add heroku/nodejs -i 1 --app $APP_NAME

echo "All done setting up env vars and add-ons."
echo "Pushing code to Heroku now. This will take a few minutes..."
git push heroku master
Expand Down

0 comments on commit 84d7d60

Please sign in to comment.