Neither ruby and nor irb can load .rb file in current directory Neither ruby and nor irb can load .rb file in current directory ruby ruby

Neither ruby and nor irb can load .rb file in current directory


None of these worked for me, but this did:

irb -I .>require 'file' => true


require './hede'

or

require_relative 'hede'

This works for me in both Ruby (1.9.3) and JRuby (1.7.x) on linux. I haven't tested it on windows.


How about this command? A little cumbersome to write but really clean and it should always work:

➜ $ irb> require "#{Dir.pwd}/file_to_load.rb"=> true