Rails Tips is open to everybody who wants to share their knowledge in Rails

Difference between load and require?

by shameermelethil | 3:11 AM in |

load will load and execute a ruby program(*.rb)

require
loads ruby program as well, but will also load binary ruby extension modules(shared libraries or dynamic link libraries).
In addition, require ensures that a feature is never loaded more than once.

3 comments:

  1. Sajit Jayaraman on August 6, 2009 at 5:54 AM

    what is the difference between require_once and require

     
  2. shameermelethil on August 6, 2009 at 9:01 PM

    I think this is not the functionality in Ruby on Rails.

     
  3. Sajit Jayaraman on August 6, 2009 at 10:39 PM

    Yes you are write it the funtionality of PHP 5.0
    PHP originated from PERL and RUBY also contains some functionalities of PERL.
    require is used in all three languages
    require_once introduced in PHP 5.O to minimize the errors in OOP.

     

About me

Shameer Melethil Pattambi/Vallappuzha