No, you absolutely can, but you need representation. Most prisoner rights suits are started without lawyers, and the courts won't generally allow class actions without a lawyer, so there aren't many filed.
My case involved access to news and mail delivery. The mail delivery claim is left open for a future class action as the judge made an excellent ruling on it, just short of handing me victory. The person behind me can cite that persuasive ruling to bring a class action if they can find representation.
Trial court judges generally do what they want, especially at the state level in the USA.
The appellate courts do the real work of determining the legality of the judge's decisions and fixing them where necessary. If you don't have the resources to marshall a competent appeal, then you're usually out of luck.
Or does class-action not apply to this kind of violation at all?