Project

General

Profile

Actions

Defect #32223

closed

Disable sprockets to avoid Sprockets::Railtie::ManifestNeededError raised by sprockets 4.0.0

Added by Go MAEDA over 4 years ago. Updated over 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Gems support
Target version:
Start date:
Due date:
% Done:

0%

Estimated time:
Resolution:
Fixed
Affected version:

Description

Redmine doesn't start with Sprockets::Railtie::ManifestNeededError if sprockets 4.0.0 is installed.

$ bin/rails c
Traceback (most recent call last):
    28: from bin/rails:4:in `<main>'
    27: from bin/rails:4:in `require'
.
.
.
/Users/maeda/redmines/gems/ruby/2.6.0/gems/sprockets-rails-3.2.1/lib/sprockets/railtie.rb:105:in `block in <class:Railtie>': Expected to find a manifest file in `app/assets/config/manifest.js` (Sprockets::Railtie::ManifestNeededError)
But did not, please create this file and use it to link any assets that need
to be rendered by your app:

Example:
  //= link_tree ../images
  //= link_directory ../javascripts .js
  //= link_directory ../stylesheets .css
and restart your server

Files

disable-sprockets.patch (1.47 KB) disable-sprockets.patch Go MAEDA, 2019-10-10 04:35
disable-sprockets.diff (1.52 KB) disable-sprockets.diff Go MAEDA, 2019-10-19 05:04
require_bench.rb (1.42 KB) require_bench.rb Pavel Rosický, 2019-10-20 14:23

Related issues

Related to Redmine - Defect #32300: Don't use sprockets 4.0.0 in order to avoid Sprockets::Railtie::ManifestNeededErrorClosedJean-Philippe Lang

Actions
Related to Redmine - Defect #32839: Redmine 4.1 installation fails due to an attempt to install sprockets 4.0.0 if bundler prior to 1.15.2 is used on Ruby prior to 2.5ClosedGo MAEDA

Actions
Related to Redmine - Defect #32852: Upgrading from Redmine v4.0.5 to v4.1.0 gives 2 errorsClosed

Actions
Actions #1

Updated by Go MAEDA over 4 years ago

The version of sprockets should be fixed at 3.7 until this issue is fixed.

diff --git a/Gemfile b/Gemfile
index 8eacdd122..762c6cefb 100644
--- a/Gemfile
+++ b/Gemfile
@@ -15,6 +15,9 @@ gem "nokogiri", "~> 1.10.0" 
 gem "i18n", "~> 1.6.0" 
 gem "rbpdf", "~> 1.20.0" 

+# TODO: Remove the following line when #32223 is fixed
+gem "sprockets", "~> 3.7.2" 
+
 # Windows does not include zoneinfo files, so bundle the tzinfo-data gem
 gem 'tzinfo-data', platforms: [:mingw, :x64_mingw, :mswin]

Actions #2

Updated by Go MAEDA over 4 years ago

  • Subject changed from Redmine doesn't start with Sprockets :: Railtie :: ManifestNeededError if sprockets 4.0.0 is installed to Redmine doesn't start with Sprockets::Railtie::ManifestNeededError if sprockets 4.0.0 is installed

Fixed the version of sprockets at 3.7 in r18629.

Actions #3

Updated by Alexander Meindl over 4 years ago

Sprockets 4 requires ruby 2.5 or newer, too. This means, at the moment if you try to install Redmine 4 with ruby e.g. 2.3, bundler is failling. Your patch is required in Redmine 4.0.x, to support older ruby versions again.

Actions #4

Updated by Go MAEDA over 4 years ago

Alexander Meindl wrote:

Sprockets 4 requires ruby 2.5 or newer, too. This means, at the moment if you try to install Redmine 4 with ruby e.g. 2.3, bundler is failling. Your patch is required in Redmine 4.0.x, to support older ruby versions again.

I have committed the same change in 4.0-stable branch in r18634. Thank you for the explanation.

Actions #5

Updated by Go MAEDA over 4 years ago

The attached patch fixes this issue. I would like Rails exports to review it.

Actions #6

Updated by Giorgos Tsirkas over 4 years ago

I have the same issue having redmine4.0.4 source, Ruby2.5 and Rails 5.2.3

Actions #7

Updated by Go MAEDA over 4 years ago

  • Subject changed from Redmine doesn't start with Sprockets::Railtie::ManifestNeededError if sprockets 4.0.0 is installed to Disable sprockets to avoid Sprockets::Railtie::ManifestNeededError raised by sprockets 4.0.0
  • Description updated (diff)
  • Target version set to 4.1.0

I would like to commit disable-sprockets.patch (#32223#note-5) after it has reviewed by people here.

Setting the target version to 4.1.0.

Actions #8

Updated by Jose Antonio Garcia over 4 years ago

Same problems appears in 3.3-stable branch.

Actions #9

Updated by Go MAEDA over 4 years ago

Jose Antonio Garcia wrote:

Same problems appears in 3.3-stable branch.

Redmine 3.3 is no longer maintained. So, an update for this issue will not be released.

However, you can fix the error by your self. Please create a file "Gemfile.local" and add the following line.

gem "sprockets", "~> 3.7.2" 
Actions #10

Updated by Mischa The Evil over 4 years ago

Two things regarding the patch from #note-5:
  1. I don't know if disabling/removing sprockets this way in the Redmine core makes enabling of the Rails asset pipeline locally more difficult than it currently is?
  2. Are you sure everything needed by the core is indeed loaded with this config?
FTR: some back-references to this issue in the forums:

FWIW: given r18635, this issue's target version should probably be set to 3.4.12.

Actions #11

Updated by Go MAEDA over 4 years ago

Mischa The Evil wrote:

  1. I don't know if disabling/removing sprockets this way in the Redmine core makes enabling of the Rails asset pipeline locally more difficult than it currently is?

Sorry, I don't know.

  1. Are you sure everything needed by the core is indeed loaded with this config?

I think active_storage and action_cable can be removed at least, but I think this issue should stick to removing sprockets because it is off-topic for this issue. We can discuss removing other libraries in another issue after the change is committed.

FWIW: given r18635, this issue's target version should probably be set to 3.4.12.

I am afraid that disabling sprockets will break some plugins.

Actions #12

Updated by Go MAEDA over 4 years ago

Updated the patch. Just replaced double quotation marks with single quotation marks.

Actions #13

Updated by Jean-Philippe Lang over 4 years ago

  • Related to Defect #32300: Don't use sprockets 4.0.0 in order to avoid Sprockets::Railtie::ManifestNeededError added
Actions #14

Updated by Mischa The Evil over 4 years ago

Go MAEDA wrote:

Mischa The Evil wrote:

  1. Are you sure everything needed by the core is indeed loaded with this config?

I think active_storage and action_cable can be removed at least, but I think this issue should stick to removing sprockets because it is off-topic for this issue. We can discuss removing other libraries in another issue after the change is committed.

What I meant was not about what else we can remove; just about what Redmine needs to function correctly.

FWIW: given r18635, this issue's target version should probably be set to 3.4.12.

I am afraid that disabling sprockets will break some plugins.

JPL fixed what I was referring to by opening #32300. IMHO this should be fixed at the root in either sprockets itself or Redmine somehow.

Actions #15

Updated by Pavel Rosický over 4 years ago

Go MAEDA your patch improves startup time and memory consumtion.

disable-sprockets.diff
before
  2.078125   4.734375   6.812500 (  8.833407)
mem: 47841280.0

after
  1.234375   2.687500   3.921875 (  3.926718)
mem: 34430976.0

but that belongs to the next version, not for maintainance releases in order to fix the sprockets problem.

Actions #16

Updated by Mischa The Evil over 4 years ago

Pavel Rosický wrote:

[...]

How do you generate these numbers? On what system? Can you remove active_storage and action_cable too and benchmark those configs too? I'm curious what difference it makes in your case.

Actions #17

Updated by Go MAEDA over 4 years ago

Mischa The Evil wrote:

Go MAEDA wrote:

Mischa The Evil wrote:

  1. Are you sure everything needed by the core is indeed loaded with this config?

I think active_storage and action_cable can be removed at least, but I think this issue should stick to removing sprockets because it is off-topic for this issue. We can discuss removing other libraries in another issue after the change is committed.

What I meant was not about what else we can remove; just about what Redmine needs to function correctly.

Sorry for the misreading.

I believe the config loads all libraries needed to run a Rails app. Actually, the set of "require" methods was not written by me but generated by `rails new appname --skip-sprockets`.

Actions #18

Updated by Pavel Rosický over 4 years ago

Mischa The Evil wrote:

Pavel Rosický wrote:

[...]

How do you generate these numbers? On what system? Can you remove active_storage and action_cable too and benchmark those configs too? I'm curious what difference it makes in your case.

benchmark included

Actions #19

Updated by Go MAEDA over 4 years ago

Mischa The Evil wrote:

IMHO this should be fixed at the root in either sprockets itself or Redmine somehow.

Probably sprockets will never be fixed. A maintainer of sprockets wrote that "you need to change the require 'rails/all' to require the individual railties and leave the sprockets railties out of the list".
https://github.com/rails/sprockets/issues/643#issuecomment-544589461

Considering the comment, disable-sprockets.diff is the right approach to fix this issue.

Actions #20

Updated by Go MAEDA over 4 years ago

  • Status changed from New to Closed
  • Assignee set to Go MAEDA
  • Resolution set to Fixed

Committed the fix to the trunk.

Actions #21

Updated by Go MAEDA over 4 years ago

  • Related to Defect #32839: Redmine 4.1 installation fails due to an attempt to install sprockets 4.0.0 if bundler prior to 1.15.2 is used on Ruby prior to 2.5 added
Actions #22

Updated by Holger Just about 4 years ago

  • Related to Defect #32852: Upgrading from Redmine v4.0.5 to v4.1.0 gives 2 errors added
Actions

Also available in: Atom PDF