Skip to content

Commit

Permalink
Unpin Sprockets gem and upgrade to version 4.
Browse files Browse the repository at this point in the history
We had this pinned to version 3.7.2 because of a segmentation
fault that occurred when upgrading to 4.0+

After investigation it seems that Sprockets now uses the manifest.js
file to compile assets instead of the assets.rb file.

See: sass/sassc-rails#122 and
https://github.com/rails/sprockets/blob/master/UPGRADING.md#manifestjs

This commit upgrades Sprockets and now uses the manifest.js file
to precompile assets which ensures the segmentation fault no
longer occurs.
  • Loading branch information
koetsier committed Sep 13, 2021
1 parent e253690 commit 77cb63f
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ gem "rqrcode"
gem "sassc-rails"
gem "sentry-rails"
gem "sentry-ruby"
gem "sprockets", "3.7.2"
gem "sprockets"
gem "two_factor_authentication"
gem "tzinfo-data"
gem "uk_postcode", "~> 2.1"
Expand Down
4 changes: 2 additions & 2 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ GEM
spring (2.1.1)
spring-commands-rspec (1.0.4)
spring (>= 0.9.1)
sprockets (3.7.2)
sprockets (4.0.2)
concurrent-ruby (~> 1.0)
rack (> 1, < 3)
sprockets-rails (3.2.2)
Expand Down Expand Up @@ -499,7 +499,7 @@ DEPENDENCIES
simplecov
simplecov-console
spring-commands-rspec
sprockets (= 3.7.2)
sprockets
timecop (~> 0.9.2)
two_factor_authentication
tzinfo-data
Expand Down
4 changes: 4 additions & 0 deletions app/assets/config/manifest.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//= link_tree ../images
//= link_directory ../stylesheets .css
//= link_directory ../javascripts .js
//= link accessible-autocomplete.min.css
//= link html5shiv.js
//= link govuk-logotype-crown.png
//= link accessible-autocomplete.min.css
11 changes: 1 addition & 10 deletions config/initializers/assets.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,11 @@
# Version of your assets, change this if you want to expire all your assets.
Rails.application.config.assets.version = "1.0"

Rails.application.config.assets.precompile += %w[
govuk-logotype-crown.png
application_ie8.css
html5shiv.js
accessible-autocomplete.min.js
accessible-autocomplete.min.css
tick.svg
cross.svg
]

Rails.application.config.assets.paths += [
Rails.root.join("node_modules/govuk-frontend/govuk/assets/images"),
Rails.root.join("node_modules/govuk-frontend/govuk/assets/fonts"),
Rails.root.join("node_modules/govuk-frontend/govuk"),
Rails.root.join("node_modules/govwifi-shared-frontend/dist"),
Rails.root.join("node_modules/html5shiv/dist"),
Rails.root.join("vendor/assets/stylesheets"),
]

0 comments on commit 77cb63f

Please sign in to comment.