Pat the beef rib roast dry with paper towels. Season all over with kosher salt and black pepper, pressing to adhere, and let sit at room temperature for 45–60 minutes while you prepare the oven.
Heat the oven to 450°F (230°C). Scatter the onion and carrot in a roasting pan to form a bed. Set a rack over the vegetables, if you have one, and place the roast fat-side up on the rack (or directly on the vegetables).
Roast at 450°F for 15–20 minutes until the surface is lightly browned.
Reduce the oven temperature to 325°F (165°C) and continue roasting for 60–90 minutes, until an instant-read thermometer inserted into the center reads 120–125°F for medium-rare or 130–135°F for medium. Begin checking after 60 minutes; total time is typically 12–15 minutes per pound after the initial high-heat phase.
Transfer the roast to a carving board, tent loosely with foil, and rest for 20–30 minutes so the juices redistribute.
Set the roasting pan with the vegetables and drippings over medium heat on the stovetop. Skim and discard excess fat, leaving about 2 tablespoons in the pan. Sprinkle in the all-purpose flour and whisk, cooking 1–2 minutes until the flour smells toasty.
Gradually whisk in the beef stock, scraping up any browned bits. Simmer 5–7 minutes, stirring, until the gravy is glossy and thick enough to lightly coat a spoon. Strain into a warm gravy boat and keep warm.
To carve, cut along the bones to remove the roast in one piece, then slice across the grain into 0.5-inch thick slices. Serve immediately with the pan gravy.