The common solution, unfortunately, is to use a 48V charger.
I can think of two potential problems with charging the batteries in circuit. First, you want the batteries to have the same charge since they are in series. If you charge them one at a time, while there is a load on the bank, they may become out of sync, some charged, some less charged. If you remove the load while charging, this would not be much of a problem, I guess, but charging them in series would still be better in terms of keeping them synced up.
Second, there could be some kind of grounding issue. Does your charger ground the battery negative terminal to earth ground? Does it have an isolation voltage rating? Does your 48V bank, or the inverter connect 48V ground to earth? Just to be explicit, imagine this. Your charger negative is earth grounded. When you charge the bottom battery, no problem. When you charge the next battery up, you would actually be shorting battery 1 + directly to battery 1 - by way of earth ground. That would be bad.