Defect #32223
closedDisable sprockets to avoid Sprockets::Railtie::ManifestNeededError raised by sprockets 4.0.0
0%
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
Related issues
Updated by Go MAEDA about 5 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]
Updated by Go MAEDA about 5 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.
Updated by Alexander Meindl about 5 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.
Updated by Go MAEDA about 5 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.
Updated by Go MAEDA about 5 years ago
- File disable-sprockets.patch disable-sprockets.patch added
The attached patch fixes this issue. I would like Rails exports to review it.
Updated by Giorgos Tsirkas about 5 years ago
I have the same issue having redmine4.0.4 source, Ruby2.5 and Rails 5.2.3
Updated by Go MAEDA about 5 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.
Updated by Jose Antonio Garcia about 5 years ago
Same problems appears in 3.3-stable branch.
Updated by Go MAEDA about 5 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"
Updated by Mischa The Evil about 5 years ago
- 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?
- Are you sure everything needed by the core is indeed loaded with this config?
FWIW: given r18635, this issue's target version should probably be set to 3.4.12.
Updated by Go MAEDA about 5 years ago
Mischa The Evil wrote:
- 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.
- 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.
Updated by Go MAEDA about 5 years ago
- File disable-sprockets.diff disable-sprockets.diff added
Updated the patch. Just replaced double quotation marks with single quotation marks.
Updated by Jean-Philippe Lang about 5 years ago
- Related to Defect #32300: Don't use sprockets 4.0.0 in order to avoid Sprockets::Railtie::ManifestNeededError added
Updated by Mischa The Evil about 5 years ago
Go MAEDA wrote:
Mischa The Evil wrote:
- 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.
Updated by Pavel Rosický about 5 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.
Updated by Mischa The Evil about 5 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.
Updated by Go MAEDA about 5 years ago
Mischa The Evil wrote:
Go MAEDA wrote:
Mischa The Evil wrote:
- 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
`.
Updated by Pavel Rosický about 5 years ago
- File require_bench.rb require_bench.rb added
Mischa The Evil wrote:
Pavel Rosický wrote:
[...]
How do you generate these numbers? On what system? Can you remove
active_storage
andaction_cable
too and benchmark those configs too? I'm curious what difference it makes in your case.
benchmark included
Updated by Go MAEDA about 5 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.
Updated by Go MAEDA about 5 years ago
- Status changed from New to Closed
- Assignee set to Go MAEDA
- Resolution set to Fixed
Committed the fix to the trunk.
Updated by Go MAEDA almost 5 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
Updated by Holger Just almost 5 years ago
- Related to Defect #32852: Upgrading from Redmine v4.0.5 to v4.1.0 gives 2 errors added