问题
After bundle update
my Rails app fails to boot with:
Expected to find a manifest file in `app/assets/config/manifest.js` (Sprockets::Railtie::ManifestNeededError)
回答1:
They've changed things with the latest version of sprockets. This error comes up because you don't have a manifest.js
created. You need to create one, and add in a few lines to make sure things are working.
Easy Steps To Solve the Problem:
Create the manifest.js file
$ mkdir -p app/assets/config
$ touch app/assets/config/manifest.js
Then copy and paste the following into the manifest.js file you just created:
//= link_tree ../images //= link_directory ../javascripts .js //= link_directory ../stylesheets .css
If you have a precompile array in your
app/config/
folder (see below for an example) e.g.app/config/production.rb
then perhaps you should move them over to yourmanifest.js
config.assets.precompile = ["admin.js", "admin.css"]
Source: Thanks to Richard Schneeman's blog - see here for more information..
回答2:
A new major version of sprockets was recently released which is not compatible with the previous version.
Either perform the steps needed to upgrade or pin to version 3.x in Gemfile
gem 'sprockets', '~>3.0'
回答3:
As suggested by link http://www.redmine.org/boards/2/topics/58169, it is a known issue. See #32223 and sprockets 4.0.0 breaks Redmine 3.4.11 with Ruby <2.5.0.
I just reproduced this issue with redmine 3.4.4, but found everything is ok with Redmine 3.4.12.
wget http://www.redmine.org/releases/redmine-3.4.12.tar.gz
来源:https://stackoverflow.com/questions/58339607/why-does-rails-fails-to-boot-with-expected-to-find-a-manifest-file-in-app-asse