When I tried to run rails s by routing to the top page and creating a controller in the middle of
Terminal
Operation not permitted
, An error statement was displayed.
System Preferences-> Security & Privacy-> Privacy-> Select Full Disk Access from the list on the left-> Check Terminal.
This solved it by restarting the terminal.
https://gori.me/mac/mac-tips/112082