# JRuby realpath and realpath for 1.8

**URL:** <https://www.ruby-forum.com/t/jruby-realpath-and-realpath-for-1-8/208294>\
**Category:** JRuby\
**Created:** [June 14, 2011, 11:57am UTC](https://www.ruby-forum.com/t/jruby-realpath-and-realpath-for-1-8/208294 "2011-06-14T11:57:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dubstep](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/cdc98d/32.png) [@dubstep](https://www.ruby-forum.com/u/dubstep)\
**Post date:** [June 14, 2011, 11:57am UTC](https://www.ruby-forum.com/t/jruby-realpath-and-realpath-for-1-8/208294/1 "2011-06-14T11:57:35Z")

</div>

Hi -

I am trying to get [rbx-require-relative | RubyGems.org | your community gem host](https://rubygems.org/gems/rbx-require-relative)  
working on JRuby.

When I run:  
$ jruby --1.9 -e ‘require\_relative “./version.rb”’

I get:

builtin/prelude.rb:38:in `require_relative': undefined method `realpath’  
for File:Class (NoMethodError)  
from -e:1

What’s wrong?

From the above, I infer that realpath should return a fully  
qualified path rather than possibly a relative path as **FILE** can do?

If so, how can one write realpath in the 1.8 flavor of JRuby?

For the record, tried this on:

jruby 1.5.6 (ruby 1.8.7 patchlevel 249) (2010-12-03 9cf97c3) (OpenJDK  
Server VM 1.6.0\_20) [i386-java]
