开发者

Undefined method error associated with a particular method

I've defined a method in a file called utility.rb. I've tried to call the method inside another file called main.rb. In main.rb, I did require that file by saying require utility, but when I ran main.rb开发者_高级运维, it gave me the undefined method error associated with that particular method. utility.rb and main.rb are in the same directory. Any idea?


I guess you have a file utility.rb in any of your installed ruby libraries. This file is loaded instead of your one. Choose a more specific name for your file or add . to the beginning of your lib search path:

$:.unshift('.')
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜