Currently working on Winderz trying to figure out why
require "some_file"
Fails but
require "./some_file"
works. The $LOAD_PATH includes the directory the files being run and loaded
are in. Hit this issue on Linux as well, not sure if it's operator error or
what.
Why does require need the "./" to find a file in the $LOAD_PATH?
Are you sure you set the load path correctly?
It should work, and works for me (on Linux).
But: why not use require_relative? That's exactly the use case.
Unless you are creating a gem, then the gem's lib directory
should already be in the load path when installed properly.
Then you can (should?) use require with paths relative to `lib',
but without the leading ".": i. e. the file `gem-dir/lib/mygem.rb'
can use `require "mygem/helper"', which should load
`gem-dir/lib/mygem/helper.rb'.
Regards,
Marcus
···
Am 06.02.2017 um 13:58 schrieb leam hall:
Currently working on Winderz trying to figure out why
require "some_file"
Fails but
require "./some_file"
works. The $LOAD_PATH includes the directory the files being run and
loaded are in. Hit this issue on Linux as well, not sure if it's
operator error or what.
Why does require need the "./" to find a file in the $LOAD_PATH?
I recall you were using 1.8.7 on CentOS; are you also using that version on
Windows?
···
On Mon, Feb 6, 2017 at 6:58 AM, leam hall <leamhall@gmail.com> wrote:
Currently working on Winderz trying to figure out why
require "some_file"
Fails but
require "./some_file"
works. The $LOAD_PATH includes the directory the files being run and
loaded are in. Hit this issue on Linux as well, not sure if it's operator
error or what.
Why does require need the "./" to find a file in the $LOAD_PATH?
I am still working on this. The simple case works on Linux but the actual code fails. My guess is I am just not seeing something and need to spend some time mapping out the code.
Leam
···
On 02/06/17 15:47, sto.mar@web.de wrote:
Am 06.02.2017 um 13:58 schrieb leam hall:
Currently working on Winderz trying to figure out why
require "some_file"
Fails but
require "./some_file"
works. The $LOAD_PATH includes the directory the files being run and
loaded are in. Hit this issue on Linux as well, not sure if it's
operator error or what.
Why does require need the "./" to find a file in the $LOAD_PATH?
Are you sure you set the load path correctly?
It should work, and works for me (on Linux).
But: why not use require_relative? That's exactly the use case.
Unless you are creating a gem, then the gem's lib directory
should already be in the load path when installed properly.
Then you can (should?) use require with paths relative to `lib',
but without the leading ".": i. e. the file `gem-dir/lib/mygem.rb'
can use `require "mygem/helper"', which should load
`gem-dir/lib/mygem/helper.rb'.
Hey Eric, I was using 2.2 and then down to 2.1.9 from RubyInstaller because
of issues. Haven't seen 2.4.0 for Windows yet. and even then I may or may
not be able to install it at work.
···
On Thu, Feb 9, 2017 at 10:43 AM, Eric Christopherson < echristopherson@gmail.com> wrote:
I recall you were using 1.8.7 on CentOS; are you also using that version
Ah, just to clarify, the issue was DevKit install as I was trying to use
Nokogiri. Now using REXML and just installed Ruby 2.3.3 on Winderz.
···
On Thu, Feb 9, 2017 at 10:48 AM, leam hall <leamhall@gmail.com> wrote:
On Thu, Feb 9, 2017 at 10:43 AM, Eric Christopherson < > echristopherson@gmail.com> wrote:
I recall you were using 1.8.7 on CentOS; are you also using that version
on Windows?
--
Eric Christopherson
Hey Eric, I was using 2.2 and then down to 2.1.9 from RubyInstaller
because of issues. Haven't seen 2.4.0 for Windows yet. and even then I may
or may not be able to install it at work.