Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Require ruby file without .rb extension?

I have a ruby file that does not have a .rb extension, and is instead identified as ruby code with a shebang at the beginning of the file: #!/usr/bin/env ruby. I want to require the code in this file in another ruby file, but it seems to be having a problem because require automatically appends the .rb extension to the files it looks for. Is there any way to suppress this behavior and make require only look for the file as the name is given?

like image 792
Kvass Avatar asked Dec 06 '13 05:12

Kvass


1 Answers

Use load instead:

load 'file-name'
like image 171
NARKOZ Avatar answered Oct 12 '22 03:10

NARKOZ