End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →
instance method
Pathname#rename
rename(p1)
ext/pathname/pathname.c
View on GitHub ↗
static VALUE
path_rename(VALUE self, VALUE to)
{
return rb_funcall(rb_cFile, id_rename, 2, get_strpath(self), to);
}
Rename the file.
See File.rename.