hello your problem is quite critical may be you will go to buy a new rug.
i have an idea for you that may help you ..
There is an easy solution to your unraveling carpet and rug edges.
I use a grass carpet mat also. If you know someone who owns a heat
shrink gun ( like a hair dryer on steroids) it can be used to melt the
frayed edges. Or if you are very very careful you can use a propane torch.
It is like sealing the ends of nylon rope