sprockets requires Ruby version >= 2.5.0 on rails 5

The latest (4.0.0) version of sprockets really requires ruby >= 2.5.0. Check it here

Is gem 'sprockets' in your Gemfile set to a specific version?

To manually change version of sprockets add the line bellow to your Gemfile

gem 'sprockets', '~> 3.7.2'

If you do not have a Gemfile yet try direct installation.

gem install sprockets -v 3.7.2


For those that are experiencing this without having it explicitly specified in the gemfile, another workaround is to install the previous version manually:

gem install sprockets -v 3.7.2