Skip to content

Commit 174cc31

Browse files
committedSep 13, 2021
Unpin Sprockets gem and upgrade to version 4.
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.
1 parent e253690 commit 174cc31

File tree

4 files changed

+7
-13
lines changed

4 files changed

+7
-13
lines changed
 

‎Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ gem "rqrcode"
2525
gem "sassc-rails"
2626
gem "sentry-rails"
2727
gem "sentry-ruby"
28-
gem "sprockets", "3.7.2"
28+
gem "sprockets"
2929
gem "two_factor_authentication"
3030
gem "tzinfo-data"
3131
gem "uk_postcode", "~> 2.1"

‎Gemfile.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ GEM
409409
spring (2.1.1)
410410
spring-commands-rspec (1.0.4)
411411
spring (>= 0.9.1)
412-
sprockets (3.7.2)
412+
sprockets (4.0.2)
413413
concurrent-ruby (~> 1.0)
414414
rack (> 1, < 3)
415415
sprockets-rails (3.2.2)
@@ -499,7 +499,7 @@ DEPENDENCIES
499499
simplecov
500500
simplecov-console
501501
spring-commands-rspec
502-
sprockets (= 3.7.2)
502+
sprockets
503503
timecop (~> 0.9.2)
504504
two_factor_authentication
505505
tzinfo-data

‎app/assets/config/manifest.js

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
//= link_tree ../images
22
//= link_directory ../stylesheets .css
33
//= link_directory ../javascripts .js
4+
//= link accessible-autocomplete.min.css
5+
//= link html5shiv.js
6+
//= link govuk-logotype-crown.png

‎config/initializers/assets.rb

+1-10
Original file line numberDiff line numberDiff line change
@@ -3,20 +3,11 @@
33
# Version of your assets, change this if you want to expire all your assets.
44
Rails.application.config.assets.version = "1.0"
55

6-
Rails.application.config.assets.precompile += %w[
7-
govuk-logotype-crown.png
8-
application_ie8.css
9-
html5shiv.js
10-
accessible-autocomplete.min.js
11-
accessible-autocomplete.min.css
12-
tick.svg
13-
cross.svg
14-
]
15-
166
Rails.application.config.assets.paths += [
177
Rails.root.join("node_modules/govuk-frontend/govuk/assets/images"),
188
Rails.root.join("node_modules/govuk-frontend/govuk/assets/fonts"),
199
Rails.root.join("node_modules/govuk-frontend/govuk"),
2010
Rails.root.join("node_modules/govwifi-shared-frontend/dist"),
2111
Rails.root.join("node_modules/html5shiv/dist"),
12+
Rails.root.join("vendor/assets/stylesheets"),
2213
]

0 commit comments

Comments
 (0)
Please sign in to comment.