Let Ω ⊂ R n be an unbounded open set. We consider the generalized weighted Morrey spaces M p(·),ϕ ω (Ω) and the vanishing generalized weighted Morrey spaces V M p(·),ϕ ω (Ω) with variable exponent p(x) and a general function ϕ(x, r) defining the Morrey-type norm. The main result of this paper are the boundedness of Riesz potential and its commutators on the spaces M p(·),ϕ ω (Ω) and V M p(·),ϕ ω (Ω) . This result generalizes several existing results for Riesz potential and its commutators on Morrey type spaces. Especially, it gives a unified result for generalized Morrey spaces and variable Morrey spaces which currently gained a lot of attentions from researchers in theory of function spaces.