First of all, welcome! and second, I wouldn't call it failure, just.... delay. At least your book was accepted to be published and that's fantastic. It's the first step, the main probably and about the money, think about possible ways of earning money, maybe a second job, online job to do at home in your free time, etc. I cannot give you many ideas as me, I am looking for one actually.
Keep on fighting for what you wish and believe! The solution will come soon.
If the invention is a particularly good one you may be able to convince a bank or an investor to invest money in it to help you finish.
And as has been mentioned just store your book away, maybe keep working on it in your head and make adjustments as you get yourself on top and eventually you'll be able to get it published.
Unless your name is already well known, breaking into markets for new inventions or books is difficult because manufacturers and/or publishers seldom want the risk of taking on the uncertainty of an unknown. You do need money, though, if only to support yourself (and family) while you are inventing things or writing. You need to have a day-job that pays the bills until your invention/book starts earning you money. Sometimes the bank can help provide the capitol for an invention in the final stages of production, but I'd not want to borrow money unless I had some pretty good offers from manufacturers interested in buying the finished product.
Regards the book - if your book has been accepted by a publisher, you shouldn't need any money to get it published. The publisher should be doing that side and giving you an advance against future sales. I'd not trust a publisher who wanted money up-front to get the book published. They have then made their money - what incentive do they then have to promote the book and get it into the bookshops? A publisher that has paid you an advance has far more incentive to then get the book sold. I would take the time to find yourself a better publisher who doesn't want maoney from you to get it published.