What is the purpose of load, auto_load, and require_relative in ruby ?



What is the purpose of load, auto_load, and require_relative in ruby ?..

Answer / Ankush Kumar

load: Loads a Ruby file into the current runtime environment. It searches for files in $LOAD_PATH (the list of directories where Ruby looks for libraries).nauto_load: Automatically loads a Ruby file when a constant referenced within that file is first accessed.nrequire_relative: Requires the relative path to another Ruby file, and it only searches the directories in the current directory's hierarchy.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Ruby on Rails Interview Questions

what is Mixin in Rails?

1 Answers  


what is the defined operator?

1 Answers  


What are generators in ruby on rails?

1 Answers  


What are filters? and how many types of filters are there in ruby

2 Answers   Baidu, TCS,


Tell me what is rails migration?

1 Answers  


What can Rails Migration do?

1 Answers  


What is the main difference between procs and blocks?

1 Answers  


When are self.up and self.down methods used?

1 Answers  


In how many ways you can create rails layout http response.

1 Answers  


What is Dynamic finders ?

1 Answers  


Tell us what is the difference between redirect and render in ruby on rails?

1 Answers  


what is the difference between calling super() and super call?

1 Answers  


Categories