Agree - File::NULL works in e. g. irb too and should work for ri. I found rdoc/ri
a bit cumbersome to use API-wise; in one project, that displays rdoc documentation
for methods (a bit similar as what pry does), I use code such as this:
ri doesn't show documentation on all constants, only classes and modules. So it is expected that ri File::NULL will not work, just as ri Date::ITALY and ri Integer::GMP_VERSION don't work.
There is a bug here, and that is that File::Constants was documented under File::File::Constants. I've traced this to a typo in rdoc, which I've submitted a pull request to fix: https://github.com/ruby/rdoc/pull/774