rm_rf synchronous , like any other ordinary ruby method.
and if it was'nt, then you will probably get the Errno::EEXIST , but you will get a "permission denied".
as a workaround, try inserting a slight delay, such as sleep(0.1) between rm_rf and mkdir
source share