Deutsche Bahn ticket machines take credit cards (the red machines). The machines of the RMV, the local transport network (the mint green ones) do not.
Anyway, having some cash at hand all the time is a necessity in this country. Withdraw some from an ATM at the airport.