プロジェクト

全般

プロフィール

Vote #80393

完了

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

Admin Redmine さんが約4年前に追加. 約4年前に更新.

ステータス:
Closed
優先度:
通常
担当者:
-
カテゴリ:
Gems support_45
対象バージョン:
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
45
version_id:
127
issue_org_id:
32223
author_id:
332
assigned_to_id:
332
comments:
22
status_id:
5
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
ステータス-->[Closed]

説明

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 `
' 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 ': 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

journals

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

<pre><code class="diff">
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]

</code></pre>
--------------------------------------------------------------------------------
Fixed the version of sprockets at 3.7 in r18629.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
The attached patch fixes this issue. I would like Rails exports to review it.

--------------------------------------------------------------------------------
I have the same issue having redmine4.0.4 source, Ruby2.5 and Rails 5.2.3
--------------------------------------------------------------------------------
I would like to commit attachment:disable-sprockets.patch (#32223#note-5) after it has reviewed by people here.

Setting the target version to 4.1.0.
--------------------------------------------------------------------------------
Same problems appears in 3.3-stable branch.
--------------------------------------------------------------------------------
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.

<pre>
gem "sprockets", "~> 3.7.2"
</pre>
--------------------------------------------------------------------------------
Two things regarding the patch from #note-5:
# 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?

FTR: some back-references to this issue in the forums:
* message#58138
* message#58169

FWIW: given r18635, this issue's target version should probably be set to 3.4.12.
--------------------------------------------------------------------------------
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 the patch. Just replaced double quotation marks with single quotation marks.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
Go MAEDA your patch improves startup time and memory consumtion.

<pre>
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
</pre>

but that belongs to the next version, not for maintainance releases in order to fix the sprockets problem.
--------------------------------------------------------------------------------
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.
--------------------------------------------------------------------------------
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@`.

--------------------------------------------------------------------------------
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
--------------------------------------------------------------------------------
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, attachment:disable-sprockets.diff is the right approach to fix this issue.
--------------------------------------------------------------------------------
Committed the fix to the trunk.
--------------------------------------------------------------------------------

--------------------------------------------------------------------------------

--------------------------------------------------------------------------------


related_issues

relates,Closed,32300,Don't use sprockets 4.0.0 in order to avoid Sprockets::Railtie::ManifestNeededError
relates,Closed,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
relates,Needs feedback,32852,Upgrading from Redmine v4.0.5 to v4.1.0 gives 2 errors

Admin Redmine さんが約4年前に更新

  • カテゴリGems support_45 にセット
  • 対象バージョン4.1.0_127 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0