A nit-picking point, but I think you mean "extracting". If the spent brass remains in the chamber when the bolt is retracted, the extractor is not working. If the spent brass is being pulled out of the chamber, but not being kicked out at the end of the bolt stroke, the ejector is not working.
Extractor problem....
Make sure the extractor (the little hook on the bolt face) moves freely and that the spring forces it firmly into the bolt face. Remove, clean, and lube as necessary.
There is a small groove at the back of the barrel into which the extractor fits when the bolt is closed. If it is full of crud, the extractor hook can not get behind the rim of the cartridge. Clean if necessary.
The hook on the extractor must be fairly sharp (not rounded) on the inside radius of the hook. If necessary, a light touch with a file will "square up" the hook. There may be an aftermarket extractor available - wouldn't surprise me if Ruger used the same part as they use on the 10/22, in which case the are a couple aftermarket extractors and extractor springs available.
Ejector problem.....
Not familiar with your rifle, but I'll bet it has a standing ejector - there will be a small longitudinal groove in the bolt and a "finger" of steel attached to the receiver that rides in the groove. When the bolt is fully to the rear, the "finger" projects into the lower left side of the bolt face and serves to pivot the spent brass around the extractor and kick it out of the port. If it's not ejecting, that part is broken, bent, or missing.