JRuby realpath and realpath for 1.8

Hi -

I am trying to get 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 methodrealpath’
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]

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs