sprockets 4.0.0 breaks Redmine 3.4.11 with Ruby <2.5.0

Added by Sierra November 2 months ago

Hi,

I've run 2 test upgrades of Redmine form v3.4.6 to 3.4.11 without any issues. But today upgrade on production server failed with following error:

Fetching sprockets 4.0.0
Installing sprockets 4.0.0
Gem::InstallError: sprockets requires Ruby version >= 2.5.0.
An error occurred while installing sprockets (4.0.0), and Bundler cannot
continue.
Make sure that `gem install sprockets -v '4.0.0' --source 'https://rubygems.org/'` succeeds
before bundling.

In Gemfile:
  redmine_crm was resolved to 0.0.47, which depends on
    rails was resolved to 4.2.11.1, which depends on
      sprockets-rails was resolved to 3.2.1, which depends on
        sprockets

Ryby version we use is 2.3 which should be more than enough for Redmine 3.4.11 (we don't want to upgrade as our policy is to use version provided by system distribution)

I've managed to overcome sprockets issue by adding following line to Redmine's Gemfile

gem "sprockets", (RUBY_VERSION < "2.5" ? "< 4.0.0" : ">= 4.0.0")

Everything seems to works just fine, but I would like to hear your opinion if workaround is ok, and if its Redmine issue or rails/sprocket-rails issue?

Forgot to add that sprockets 4.0.0 was released just about 12 hours ago, at the time I've aleady finished second test update and just before I prepared for production update.

sn

Replies (4)

RE: sprockets 4.0.0 breaks Redmine 3.4.11 with Ruby <2.5.0 - Added by Go MAEDA 2 months ago

Sierra November wrote:

gem "sprockets", (RUBY_VERSION < "2.5" ? "< 4.0.0" : ">= 4.0.0")

Redmine does not run with sprockets 4.0.0 even if you use Ruby 2.5 or later. Please see #32223.

So, I think we should use sprockets 3.7.x regardless of the version of Ruby.

gem "sprockets", "~> 3.7.2" 

RE: sprockets 4.0.0 breaks Redmine 3.4.11 with Ruby <2.5.0 - Added by Sierra November 2 months ago

Thanks. Then it is even more general issue, it seems so fresh that I could not google that one out:

Redmine does not run with sprockets 4.0.0 even if you use Ruby 2.5 or later. Please see #32223.

I was searching for sprockets and Redmnine 3.4, and sprockets 4.0.0 breaks both branches if Ruby version is less than 2.5.0 which is AFAIK quite common.

sn

RE: sprockets 4.0.0 breaks Redmine 3.4.11 with Ruby <2.5.0 - Added by Go MAEDA 2 months ago

Updated the Gemfile for 3.4-stable in r18635. Thank you for reporting the error.

RE: sprockets 4.0.0 breaks Redmine 3.4.11 with Ruby <2.5.0 - Added by Jose Antonio Garcia 2 months ago

Same problems occurs in 3.3-stable branch

(1-4/4)