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

前端 未结 7 1139
慢半拍i
慢半拍i 2021-01-31 17:30

I\'m having a really noob problem with importing files in Ruby. I\'m making a Ruby app in Windows XP. All the class files for the app are in \"C:/Documents/Prgm/Surveyor_R

7条回答
  •  孤独总比滥情好
    2021-01-31 18:03

    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.

提交回复
热议问题