Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
806 views
in Technique[技术] by (71.8m points)

capistrano - rails deployment in development with webpacker failing when precompiling assets

upon launching capistrano deployment, it stops upon precompilation of assets

INFO [7e60e5e4] Running $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile as [email protected]
 DEBUG [7e60e5e4] Command: cd /home/deploy/zappa/releases/20210110095959 && ( export RBENV_ROOT="$HOME/.rbenv" RBENV_VERSION="2.6.1" RAILS_ENV="development" RAILS_GROUPS="" ; $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile )
 DEBUG [7e60e5e4]   error Couldn't find an integrity file
 DEBUG [7e60e5e4]   error Found 1 errors.
 DEBUG [7e60e5e4]   

========================================
  Your Yarn packages are out of date!
  Please run `yarn install --check-files` to update.
========================================


To disable this check, please change `check_yarn_integrity`
to `false` in your webpacker config file (config/webpacker.yml).

I've run yarn install --check-files on both local and target server. Locally, all is up-to-date:

yarn install v1.22.5
[1/4] ??  Resolving packages...
success Already up-to-date.
?  Done in 1.99s.

while on the server this is run within the latest release and percolates:

yarn install v1.22.5
[1/4] Resolving packages...
[2/4] Fetching packages...
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
info [email protected]: The platform "linux" is incompatible with this module.
info "[email protected]" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning " > [email protected]" has unmet peer dependency "webpack@^4.0.0 || ^5.0.0".
warning "webpack-dev-server > [email protected]" has unmet peer dependency "webpack@^4.0.0".
[4/4] Building fresh packages...
Done in 11.35s.

But that release is unusable as any further deployment will be done into a new directory.

And contrary to the suggestion, under the development block of webpacker.yml

check_yarn_integrity: false

does not change this behaviour.

Not sure whether this a rails, webpacker or capistrano issue.

How can this viscious circle be undone?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

in config/deploy.rb ensure that

append :linked_dirs, node_modules is included
then run yarn install --check-filesfrom within the latest repository.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...