wasn't amazingly effective (it took pineapples about 3 years to fruit)
That's not that bad. If you live in an area with summer/winter cycles instead of dry/wet then it's only ever going to fruit in summer. It will never fruit in the first year, even if you live in the perfect climate. So it will either fruit in the second summer or the third summer. Even in perfect climates you're still looking at about two years before it fruits so it's not that far behind. The winter is always going to slow down the growth, if it fruits in the second year in the perfect climate then that will just push it to the third year. In the grand scheme of things for tropical fruit in a non tropical climate pineapples aren't the worst. It's doable with a bit of effort. But something like a mango? You're not getting that to fruit at all without an almost impossibly high amount of effort. They're not that much harder than something like a dragon or passion fruit it's just they are fucking unpleasant to be around and have a large footprint.
how do i get rid of rats coming to my garden and tearing my shit up?
Depends on your garden. Snap traps are the best but don't leave them outside. It'd have to be in some sort of shed that only a rat could get in. Get both mice and rat snap traps. Super glue a peanut or something hard (never peanut butter or chocolate depending on climate) to the paddle and pour more super glue on top afterwards. If you don't have a shed then the only thing you can use ethically is a live trap but you would have to check that several times a day every single day. Also depending on where you live it can be illegal to release pests/invasive animals from a live trap so you will have to be prepared to actually force the rat into a sack and bash it's head in or shoot it and if you are not mentally prepared to do that then do not buy a live trap. Even if it's legal to release them you really shouldn't release rats, not on a legal standpoint but on a ethical one.
The traditional (and most cost effective) solution is to get a cat.
Not really if it's in the garden. Yea you might scare off a few rats but you're going to end up with a load of dead birds if you're letting a cat outside. At that point you might as well leave poisons everywhere.
their living under my neighbor's porch
The thing with vermin is that unless you deal with this part then the problem won't go away. Even if you kill every single rat then it won't fix anything. If you do not remove what drew them to your area in the first place then the only thing that will happen is more will be attracted after a while. I don't really know where you live but if you're American can't you pull some hoa bullshit and report them until they get their shit fixed? Especially if there's a lot of them and they're breeding then they
will come back unless that is fixed. Your problem isn't that rats come into your garden. Your problem is that you live close to a rat nest (assumedly). It isn't hard to fix that problem, it should just be stick some traps in that space until they don't catch anything and then fill whatever hole they are getting in through. But if they're indians then, well, as I say, your problem isn't the vermin being near you, the problem is that the vermin are living and breeding near you.
Also don't bother changing your soil. That's not something to worry about. Hantavirus also is probably not an issue near you anyway. It's not going to be in your soil and it can't survive for a long time in soil anyway. However. Wash your hands thoroughly any time you're digging in the soil anyway. If you touch anything where a rat or mouse may have been then wash your hands. That's not a hantavirus thing, that's just in general. The shit you can catch from rodents already is as bad or worse than hantavirus. But unless you're eating your soil it doesn't matter. Wash produce you eat but once again you should already be doing that. Also wear disposable gloves when handling used traps and dead animals and look up a video on how to properly remove disposable gloves so you don't touch your skin.