EMFILEis too many files opened in your process.ENFILEis too many files opened in the entire system.
So Errno::EMFILE is due to the ruby process opening too many files. This limit is probably set to the default 1024 can be seen with:
$ulimit -n
1024
Instead of:
$ulimit
unlimited
You can raise the limit using this method.