From: windwiny Date: 2013-06-03T14:44:06+09:00 Subject: Re: 'require' is not loading files --089e0118381e69b21604de3957b7 Content-Type: text/plain; charset=UTF-8 require './b' or require_relative 'b' 2013/6/3 Elliot M. > I am new to ruby and have been teaching it to myself for the past so I > am still very new to Ruby. I have been trying to load external > source-code files into my program but for some reason every time I try > use require to load a file it does not work and I get this message > > LoadError: cannot load such file -- b > from > /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in > `require' > from > /usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in > `require' > from (irb):3 > from /usr/local/bin/irb:12:in `
' > irb(main):004:0> require > > > For example I create a file named a.rb and then in another program I try > to load it with require 'a' but I always get this message. When I use > load 'a.rb' it loads the file with no problem but I can not figure out > why require '' will not load the files into the program. Like I said I > am very new to Ruby so any help is appreciated. > > -- > Posted via http://www.ruby-forum.com/. > > --089e0118381e69b21604de3957b7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
require './b'

or=C2=A0

require_relative 'b'
=


2013/6/3 Elli= ot M. <lists@ruby-forum.com>
I am new to ruby and have been teaching it t= o myself for the past so I
am still very new to Ruby. I have been trying to load external
source-code files into my program but for some reason every time I try
use require to load a file it does not work and I get this message

LoadError: cannot load such file -- b
=C2=A0 =C2=A0 =C2=A0 =C2=A0 from
/usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
`require'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 from
/usr/local/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in
`require'
=C2=A0 =C2=A0 =C2=A0 =C2=A0 from (irb):3
=C2=A0 =C2=A0 =C2=A0 =C2=A0 from /usr/local/bin/irb:12:in `<main>'= ;
irb(main):004:0> require


For example I create a file named a.rb and then in another program I try to load it with require 'a' but I always get this message. When I u= se
load 'a.rb' it loads the file with no problem but I can not figure = out
why require '' will not load the files into the program. Like I sai= d I
am very new to Ruby so any help is appreciated.

--
Posted via http://= www.ruby-forum.com/.


--089e0118381e69b21604de3957b7--