The habitats where Ray's knotgrass~(Polygonum oxyspermum subsp. Raii) grows:

Coastal vegetated shingle
Sand dune