我想
yarn
rbenv exec
也许?
desc "Yarn Install"
task :yarn_install do
on roles(:all) do |host|
execute :yarn, :install, "--production"
end
end
然后,用
bundle exec cap production yarn_install
或者,从其他任务中调用该任务。
在Gemfile中,删除或注释“capistrano yarn”
#gem 'capistrano-yarn'
在Capfile中,删除或注释“capistrano/yarn”
#require 'capistrano/yarn'
创建新项目:
rails new <name> --skip-yarn
webpacker.check_yarn_integrity
到
false
应用内环境文件(即app/config/development.rb app/config/production.rb)
config.webpacker.check_yarn_integrity = false
javascript_pack_tag
或
stylesheet_pack_tag
在里面
app/views/*
路径,然后将它们注释掉,如下所示:
<%# javascript_pack_tag "" %>
<%# stylesheet_pack_tag "" %>