I would cut pieces of foam for the rim joist. And seal with caulk.
Agree ^^^ its a valid method over just using plain spray foam.
Get nice thick foam board, put it up and seal with spray foam. Much more simple for the DIY and many professionals will also use the same method.
Me personally would spray some foam along any seams, place the foam board in right away and seal again with the spray foam.. Here is an example