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

前端 未结 7 1160
慢半拍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 17:46

    I believe both of the previous posts are correct, just for different uses. In IRB use an absolute path with require, with a file you can also use require with an absolute path, or use require_relative.

提交回复
热议问题