On Wed, Apr 17, 2013 at 8:46 PM, Gouverneur Cadwalader <lists / ruby-forum.com
> wrote:

> Hello. This is my first post and I'm new to coding and ruby. I'm
> trying to learn the basics right now from Lynda.com. I'm trying to run
> the above file "methods.rb" from the command line. In the command prompt
> I navigate to the correct folder, switch to irb, and then I use
> >require"methods.rb".
>
> In the lynda tutorial video, this returns >true. It works.
>
> When I do it, I get
>
> LoadError: cannot load such file -- methods.rb
>    from
> C:/Ruby200/lob/ruby/2.0/rubygems/core_ext/kernel_require.rb:45:in
> 'require'
>    from
> C:/Ruby200/lob/ruby/2.0/rubygems/core_ext/kernel_require.rb:45:in
> 'require'
>    from (irb):2
>    from C:/Ruby200/bin/irb:12:in '<main>'
>
> This tutorial I'm watching is about four years old, so he's using an
> older version of ruby. I know this is probably the simplest thing, but
> as a newbie I have zero decoding skill. Any help would be appreciated.
>

I think that's it. Ruby from 1.9.2 on does not allow you to `require` files
in the current working directory, unless you add that directory to
$LOAD_PATH; earlier versions automatically put it there for you. The
easiest way around that is to use `require_relative`.

I don't know what the Lynda tutorial does with code that you've required,
but if you just want to run a Ruby file from Windows's cmd, you can just
run `ruby methods.rb`. That's a little more direct, but it puts you back in
cmd when it finishes.


>
> Lastly, if you know of a better way to start learning ruby than the
> lynda tutorail series, I'm very open to input of any kind.
>
> Thanks in advance,
> -S.
>