Is there any major difference between load and require in the Ruby on Rails applications? Or do they both have the same functionality?
Is there any major difference between load and require in the Ruby on Rails
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
requiresearches for the library in all the defined search paths and also appends.rb or .so to the file name you enter. It also makes sure that a library is only
included once. So if your application requires library A and B and library B requries library A too A would be loaded only once.
With
loadyou need to add the full name of the library and it gets loaded every time youcall
load– even if it already is in memory.