Pathname
is one of those pieces of the Ruby Standard Library that are not available in RubyMotion.
You can try with MotionBundler, but I personally haven't been very lucky with that.
I'd suggest to use the Cocoa equivalent. Something like:
name = "/path/to/some/file".lastPathComponent
Not that bad, anyway.