I tried to reproduce the issue with this example script but couldn't
https://gist.github.com/dc5b6ff5b398b02e90df
Can you try to test with it on your database?
Based on error message it means that there are too many unique SQL
statements created which each requires cursor at database side.
What your database.yml looks like? Haven't you changed cursor_sharing
option?
And is only Rails app using this database? Maybe some other
application is causing shortage of available cursors?
Can you ask your Oracle DBA to take a look on open cursors at database
side to identify what SQL statements are creating these cursors?
Raimonds