我正在使用Capistrano部署我的Rails应用。
assets:precompile
由于使用旧代码而失败。为什么不使用新安装的纱线卷装?
我已分叉@fancyapps/fancybox
来解决this issue。
gulp
任务。unquote-max-css-function
的新分支上现在是时候在我的项目中使用它了。
冉yarn upgrade git+ssh://git@github.com:light-flight/fancybox.git#unquote-max-css-function
在本地有效-所有代码捆绑成功。但是在生产中,它在assets:precompile
期间正在使用旧资产(请参见下面的日志)。
我确定Yarn绑定了我的仓库,因为它之前曾询问过访问权限。
生产错误:
...
00:24 yarn:install
01 yarn install --production
01 yarn install v1.12.3
01 [1/4] Resolving packages...
01 [2/4] Fetching packages...
01 warning Pattern ["animate.css@latest"] is trying to unpack in the same destination "/home/deploy/.cache/yarn/v4/npm-animate-css-3.7.0-5de25d…
01 info fsevents@1.2.9: The platform "linux" is incompatible with this module.
01 info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
01 [3/4] Linking dependencies...
01 warning "@rails/webpacker > pnp-webpack-plugin > ts-pnp@1.1.2" has unmet peer dependency "typescript@*".
01 warning " > webpack-dev-server@3.3.1" has unmet peer dependency "webpack@^4.0.0".
01 warning "webpack-dev-server > webpack-dev-middleware@3.6.2" has unmet peer dependency "webpack@^4.0.0".
01 [4/4] Building fresh packages...
01 Done in 15.13s.
00:41 deploy:assets:precompile
01 ~/.rvm/bin/rvm default do bundle exec rake assets:precompile
01 yarn install v1.12.3
01 [1/4] Resolving packages...
01 success Already up-to-date.
01 Done in 1.30s.
01 rake aborted!
01 SassC::SyntaxError: Error: "env(safe-area-inset-right)" is not a number for `max'
01 on line 11366 of stdin, in function `max`
01 from line 11366 of stdin
01 >> padding: 75px max(44px, env(safe-area-inset-right)) max(25px, env(safe-a
01 ------------------^
01 stdin:11366
01 /home/deploy/apps/app/shared/bundle/ruby/2.6.0/gems/sassc-2.0.1/lib/sassc/engine.rb:49:in `render'
01 /home/deploy/apps/app/shared/bundle/ruby/2.6.0/gems/sassc-rails-2.1.1/lib/sassc/rails/compressor.rb:29:in `call'
01 /home/deploy/apps/app/shared/bundle/ruby/2.6.0/gems/sprockets-3.7.2/lib/sprockets/sass_compressor.rb:28:in `call'
...
如您所见,它尝试使用未引用的max
函数来编译旧代码。
在本地编译成功:
$ rails assets:precompile
yarn install v1.15.2
[1/4] Resolving packages...
success Already up-to-date.
Done in 1.42s.
I, [2019-05-05T13:02:34.620408 #10872] INFO -- : Writing /home/user/apps/app/public/assets/application-6f331dc14f50de04a8e7dd5d4c4882ffbf78cefc5ac4d73294ea48912d74a2a5.css
I, [2019-05-05T13:02:34.620871 #10872] INFO -- : Writing /home/user/apps/app/public/assets/application-6f331dc14f50de04a8e7dd5d4c4882ffbf78cefc5ac4d73294ea48912d74a2a5.css.gz
我尝试yarn cache clean
,但没有任何改变。如何迫使铁轨使用我的叉子?