Julia 1.9-rc2 Pluto not plots not working

Hi,
a selecting the Julia 1.9-rc2 kernel in a Pluto notebook on my Apple silicon Mac and plotting (for instance running plot(rand(10)) results in the following error:

MethodError: no method matching project_rel_path(::Pkg.Types.EnvCache, ::Nothing)

e[0mClosest candidates are:
e[0m  project_rel_path(::Pkg.Types.EnvCache, e[91m::Stringe[39m)
e[0me[90m   @e[39m e[35mPkge[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mOperations.jl:922e[24me[39m

Stacktrace:
  [1] e[0me[1mpackage_infoe[22me[0me[1m(e[22me[90menve[39m::e[0mPkg.Types.EnvCache, e[90mpkge[39m::e[0mPkg.Types.PackageSpec, e[90mentrye[39m::e[0mPkg.Types.PackageEntrye[0me[1m)e[22m
e[90m    @e[39m e[35mPkg.APIe[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:65e[24me[39m
  [2] e[0me[1mpackage_infoe[22me[0me[1m(e[22me[90menve[39m::e[0mPkg.Types.EnvCache, e[90mpkge[39m::e[0mPkg.Types.PackageSpece[0me[1m)e[22m
e[90m    @e[39m e[35mPkg.APIe[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:58e[24me[39m
  [3] e[0me[1m#9e[22m
e[90m    @e[39m e[90m./e[39me[90me[4marray.jl:0e[24me[39me[90m [inlined]e[39m
  [4] e[0me[1miteratee[22m
e[90m    @e[39m e[90m./e[39me[90me[4mgenerator.jl:47e[24me[39me[90m [inlined]e[39m
  [5] e[0me[1m_alle[22me[0me[1m(e[22me[90mfe[39m::e[0mBase.var"#372#374", e[90mitre[39m::e[0mBase.Generatore[90m{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}}e[39m, e[90m#unused#e[39m::e[0mColone[0me[1m)e[22m
e[90m    @e[39m e[90mBasee[39m e[90m./e[39me[90me[4mreduce.jl:1292e[24me[39m
  [6] e[0me[1malle[22m
e[90m    @e[39m e[90m./e[39me[90me[4mreduce.jl:1278e[24me[39me[90m [inlined]e[39m
  [7] e[0me[1mDicte[22me[0me[1m(e[22me[90mkve[39m::e[0mBase.Generatore[90m{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}}e[39me[0me[1m)e[22m
e[90m    @e[39m e[90mBasee[39m e[90m./e[39me[90me[4mdict.jl:111e[24me[39m
  [8] e[0me[1mdependenciese[22m
e[90m    @e[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:85e[24me[39me[90m [inlined]e[39m
  [9] e[0me[1mdependenciese[22m
e[90m    @e[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:82e[24me[39me[90m [inlined]e[39m
 [10] e[0me[1m_check_installede[22me[0me[1m(e[22me[90mbackende[39m::e[0mModule; e[90mwarne[39m::e[0mBoole[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:41e[24me[39m
 [11] e[0me[1m_check_installede[22m
e[90m    @e[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:17e[24me[39me[90m [inlined]e[39m
 [12] e[0me[1m_check_compate[22me[0me[1m(e[22me[90mme[39m::e[0mModule; e[90mwarne[39m::e[0mBoole[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:48e[24me[39m
 [13] e[0me[1m_check_compate[22me[0me[1m(e[22me[90mme[39m::e[0mModulee[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:47e[24me[39m
 [14] top-level scope
e[90m    @e[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:404e[24me[39m
 [15] e[0me[1mevale[22m
e[90m    @e[39m e[90m./e[39me[90me[4mboot.jl:370e[24me[39me[90m [inlined]e[39m
 [16] e[0me[1m_initialize_backende[22me[0me[1m(e[22me[90mpkge[39m::e[0mPlots.GRBackende[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:401e[24me[39m
 [17] e[0me[1mbackende[22me[0me[1m(e[22me[90mpkge[39m::e[0mPlots.GRBackende[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:266e[24me[39m
 [18] e[0me[1mbackende[22me[0me[1m(e[22me[90msyme[39m::e[0mSymbole[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:276e[24me[39m
 [19] e[0me[1mload_default_backende[22me[0me[1m(e[22me[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:207e[24me[39m
 [20] e[0me[1mbackende[22me[0me[1m(e[22me[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:254e[24me[39m
 [21] top-level scope
e[90m    @e[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4minit.jl:83e[24me[39m
 [22] e[0me[1mincludee[22me[0me[1m(e[22me[90mmode[39m::e[0mModule, e[90m_pathe[39m::e[0mStringe[0me[1m)e[22m
e[90m    @e[39m e[90mBasee[39m e[90m./e[39me[90me[4mBase.jl:457e[24me[39m
 [23] e[0me[1mincludee[22me[0me[1m(e[22me[90mxe[39m::e[0mStringe[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mPlots.jl:1e[24me[39m
 [24] top-level scope
e[90m    @e[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mPlots.jl:176e[24me[39m
 [25] e[0me[1mincludee[22m
e[90m    @e[39m e[90m./e[39me[90me[4mBase.jl:457e[24me[39me[90m [inlined]e[39m
 [26] e[0me[1minclude_package_for_outpute[22me[0me[1m(e[22me[90mpkge[39m::e[0mBase.PkgId, e[90minpute[39m::e[0mString, e[90mdepot_pathe[39m::e[0mVectore[90m{String}e[39m, e[90mdl_load_pathe[39m::e[0mVectore[90m{String}e[39m, e[90mload_pathe[39m::e[0mVectore[90m{String}e[39m, e[90mconcrete_depse[39m::e[0mVectore[90m{Pair{Base.PkgId, UInt128}}e[39m, e[90msourcee[39m::e[0mStringe[0me[1m)e[22m
e[90m    @e[39m e[90mBasee[39m e[90m./e[39me[90me[4mloading.jl:2012e[24me[39m
 [27] top-level scope
e[90m    @e[39m e[90me[4mstdin:2e[24me[39m
in expression starting at /Users/ole.petersen/.julia/packages/Plots/p3KMq/src/init.jl:83
in expression starting at /Users/ole.petersen/.julia/packages/Plots/p3KMq/src/Plots.jl:1
in expression starting at stdin:2

e[91mcaused by: e[39mMethodError: no method matching project_rel_path(::Pkg.Types.EnvCache, ::Nothing)

e[0mClosest candidates are:
e[0m  project_rel_path(::Pkg.Types.EnvCache, e[91m::Stringe[39m)
e[0me[90m   @e[39m e[35mPkge[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mOperations.jl:922e[24me[39m

Stacktrace:
  [1] e[0me[1mpackage_infoe[22me[0me[1m(e[22me[90menve[39m::e[0mPkg.Types.EnvCache, e[90mpkge[39m::e[0mPkg.Types.PackageSpec, e[90mentrye[39m::e[0mPkg.Types.PackageEntrye[0me[1m)e[22m
e[90m    @e[39m e[35mPkg.APIe[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:65e[24me[39m
  [2] e[0me[1mpackage_infoe[22me[0me[1m(e[22me[90menve[39m::e[0mPkg.Types.EnvCache, e[90mpkge[39m::e[0mPkg.Types.PackageSpece[0me[1m)e[22m
e[90m    @e[39m e[35mPkg.APIe[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:58e[24me[39m
  [3] e[0me[1m#9e[22m
e[90m    @e[39m e[90m./e[39me[90me[4marray.jl:0e[24me[39me[90m [inlined]e[39m
  [4] e[0me[1miteratee[22m
e[90m    @e[39m e[90m./e[39me[90me[4mgenerator.jl:47e[24me[39me[90m [inlined]e[39m
  [5] e[0me[1mDict{Base.UUID, Pkg.API.PackageInfo}e[22me[0me[1m(e[22me[90mkve[39m::e[0mBase.Generatore[90m{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}}e[39me[0me[1m)e[22m
e[90m    @e[39m e[90mBasee[39m e[90m./e[39me[90me[4mdict.jl:85e[24me[39m
  [6] e[0me[1mdict_with_eltypee[22m
e[90m    @e[39m e[90m./e[39me[90me[4mabstractdict.jl:581e[24me[39me[90m [inlined]e[39m
  [7] e[0me[1mdict_with_eltypee[22m
e[90m    @e[39m e[90m./e[39me[90me[4mabstractdict.jl:588e[24me[39me[90m [inlined]e[39m
  [8] e[0me[1mDicte[22me[0me[1m(e[22me[90mkve[39m::e[0mBase.Generatore[90m{Vector{Pkg.Types.PackageSpec}, Pkg.API.var"#9#10"{Pkg.Types.EnvCache}}e[39me[0me[1m)e[22m
e[90m    @e[39m e[90mBasee[39m e[90m./e[39me[90me[4mdict.jl:109e[24me[39m
  [9] e[0me[1mdependenciese[22m
e[90m    @e[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:85e[24me[39me[90m [inlined]e[39m
 [10] e[0me[1mdependenciese[22m
e[90m    @e[39m e[90m~/.julia/juliaup/julia-1.9.0-rc2+0.aarch64.apple.darwin14/share/julia/stdlib/v1.9/Pkg/src/e[39me[90me[4mAPI.jl:82e[24me[39me[90m [inlined]e[39m
 [11] e[0me[1m_check_installede[22me[0me[1m(e[22me[90mbackende[39m::e[0mModule; e[90mwarne[39m::e[0mBoole[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:41e[24me[39m
 [12] e[0me[1m_check_installede[22m
e[90m    @e[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:17e[24me[39me[90m [inlined]e[39m
 [13] e[0me[1m_check_compate[22me[0me[1m(e[22me[90mme[39m::e[0mModule; e[90mwarne[39m::e[0mBoole[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:48e[24me[39m
 [14] e[0me[1m_check_compate[22me[0me[1m(e[22me[90mme[39m::e[0mModulee[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:47e[24me[39m
 [15] top-level scope
e[90m    @e[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:404e[24me[39m
 [16] e[0me[1mevale[22m
e[90m    @e[39m e[90m./e[39me[90me[4mboot.jl:370e[24me[39me[90m [inlined]e[39m
 [17] e[0me[1m_initialize_backende[22me[0me[1m(e[22me[90mpkge[39m::e[0mPlots.GRBackende[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:401e[24me[39m
 [18] e[0me[1mbackende[22me[0me[1m(e[22me[90mpkge[39m::e[0mPlots.GRBackende[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:266e[24me[39m
 [19] e[0me[1mbackende[22me[0me[1m(e[22me[90msyme[39m::e[0mSymbole[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:276e[24me[39m
 [20] e[0me[1mload_default_backende[22me[0me[1m(e[22me[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:207e[24me[39m
 [21] e[0me[1mbackende[22me[0me[1m(e[22me[0me[1m)e[22m
e[90m    @e[39m e[36mPlotse[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4mbackends.jl:254e[24me[39m
 [22] top-level scope
e[90m    @e[39m e[90m~/.julia/packages/Plots/p3KMq/src/e[39me[90me[4minit.jl:83e[24me[39m
 [23] e[0me[1mincludee[22me[0me[1m(e[22me[90mmode[39m::e[0mModule, e[90m_pathe[39m::e[0mStringe[0me[1m)e[22m

and

{
	"name": "ErrorException",
	"message": "Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to \"/Users/me/.julia/compiled/v1.9/Plots/jl_hXfI5h\".",
	"stack": "Failed to precompile Plots [91a5bcdd-55d7-5caf-9e0b-520d859cae80] to \"/Users/me/.julia/compiled/v1.9/Plots/jl_hXfI5h\".\n\nStacktrace:\n  [1] error(s::String)\n    @ Base ./error.jl:35\n  [2] compilecache(pkg::Base.PkgId, path::String, internal_stderr::IO, internal_stdout::IO, keep_loaded_modules::Bool)\n    @ Base ./loading.jl:2262\n  [3] compilecache\n    @ ./loading.jl:2129 [inlined]\n  [4] _require(pkg::Base.PkgId, env::String)\n    @ Base ./loading.jl:1772\n  [5] _require_prelocked(uuidkey::Base.PkgId, env::String)\n    @ Base ./loading.jl:1623\n  [6] macro expansion\n    @ ./loading.jl:1611 [inlined]\n  [7] macro expansion\n    @ ./lock.jl:267 [inlined]\n  [8] require(into::Module, mod::Symbol)\n    @ Base ./loading.jl:1574\n  [9] eval\n    @ ./boot.jl:370 [inlined]\n [10] include_string(mapexpr::typeof(REPL.softscope), mod::Module, code::String, filename::String)\n    @ Base ./loading.jl:1866\n [11] #invokelatest#2\n    @ ./essentials.jl:816 [inlined]\n [12] invokelatest\n    @ ./essentials.jl:813 [inlined]\n [13] (::VSCodeServer.var\"#198#199\"{VSCodeServer.NotebookRunCellArguments, String})()\n    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/serve_notebook.jl:19\n [14] withpath(f::VSCodeServer.var\"#198#199\"{VSCodeServer.NotebookRunCellArguments, String}, path::String)\n    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/repl.jl:249\n [15] notebook_runcell_request(conn::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, params::VSCodeServer.NotebookRunCellArguments)\n    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/serve_notebook.jl:13\n [16] dispatch_msg(x::VSCodeServer.JSONRPC.JSONRPCEndpoint{Base.PipeEndpoint, Base.PipeEndpoint}, dispatcher::VSCodeServer.JSONRPC.MsgDispatcher, msg::Dict{String, Any})\n    @ VSCodeServer.JSONRPC ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/JSONRPC/src/typed.jl:67\n [17] serve_notebook(pipename::String, outputchannel_logger::Base.CoreLogging.SimpleLogger; crashreporting_pipename::String)\n    @ VSCodeServer ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/packages/VSCodeServer/src/serve_notebook.jl:139\n [18] top-level scope\n    @ ~/.vscode/extensions/julialang.language-julia-1.38.2/scripts/notebook/notebook.jl:32"
}

Plotting from a terminal works perfectly.

I had this same problem on macOS after upgrading from 1.8 to Julia 1.9 (stable), although for me using Plots failed even in the REPL.

I had a hunch that this seemed like a caching problem since Pkg was suddenly unable to find the path for Plots, and fixed it by removing the Plots package and then re-adding it.