Please update the documentation to account for this:
Using blocks to define abilities in CanCan raises an exception
This tripped me up as well and I can't find anything in the documentation about it.
Thanks. I'll add this to the documentation. I should probably improve the wording of the exception too.
Closing this since I've updated the documentation in Defining Abilities with Blocks to mention that accessible_by will raise an exception if SQL is not provided. The exception message is also improved.