What sort of surface preparation did you do prior to gluing? Contact adhesive used right will work. I assume a painted steel trailer tub? Give the paint a good scuff up, wash down with prepwash or thinners, a good even coverage of adhesive to both surfaces, let the adhesive tack off, then fix down. Use a heavy roller to help push the carpet down.
Hammertone type paints can also cause issued with glues.
Along exposed edges carpet lifting can almost always be a problem, some type of aluminium diminishing strip is generally better.
If you don't want to re-glue the whole lot, but fix the edges. Maybe a Sikaflex type adhesive?