Forum: Ruby IRB REQUIRE ERROR

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
604a4e94b61ba3862c9672873a642950?d=identicon&s=25 Joseph Muturi (canyah)
on 2016-12-23 04:13
Attachment: irb.error.png (90 KB)
I can not require a file, even rubygems returns false
at first i had ruby 1.9.3 and i was getting this same problem.
I thought uninstalling it and installing the latest would help, but alas
i was wrong, please help. I am very new to ruby, I have googled and yet
found no solution.
Much Gratitude.
4828d528e2e46f7c8160c336eb332836?d=identicon&s=25 Robert Heiler (shevegen)
on 2016-12-28 21:08
The require 'rubygems' should not be necessary, at the least not on
newer ruby versions. 1.9.3 looks quite old, can you not upgrade on
windows?

To the situation of being unable to find a file, try if the file exists:

    p Dir['*']

Is the file in the directory?

If so, try the same via

    require_relative

instead.

You can also possibly try to add the current directory to your working
directory or load path e . g. $: if I recall correctly. But first, also
make sure that the file exists; you can also use:

    File.exist? name_of_file_here

To see that it exists.
0fa73332c8e4a3b06ea439fd3f034322?d=identicon&s=25 Ronald Fischer (rovf)
on 2016-12-31 08:21
You need to provide more information. Are you requiring

- stuff from the standard library (i.e. set, fileutils etc.)
- gems
- Ruby code you provided
This topic is locked and can not be replied to.