Ruby 'require' error: cannot load such file
I just tried and it works with
require "./tokenizer". Hope this helps.
Ruby error : Cannot load such file
Based on your Ruby version, using
require assumes that
image_utils.rb is in the $LOAD_PATH (this requires additional setup) as Ruby 1.9 has removed the current directory from the load path. Use
Ruby will first try to resolve the file by its absolute path. Then, if it isn't found then it will check on the $LOAD_PATH as mentioned above, if not then it will throw a
Rails `require': cannot load such file -- matrix
Matrix was removed from Ruby's standard library in version 3.1. More info: https://www.ruby-lang.org/en/news/2021/12/25/ruby-3-1-0-released/
With Ruby 3.1, matrix needs to be explicitly added to the Gemfile. You can add it manually or run something like:
$ bundle add matrix
After it's added to the Gemfile, bundle your application:
$ bundle install
Then your application should continue to behave like it did in previous Ruby versions.
Ruby `require': cannot load such file (LoadError)
According to API Dock,
require_relative is what you need.
Ruby tries to load the library named string relative to the requiring
file’s path. If the file’s path cannot be determined a LoadError is
raised. If a file is loaded true is returned and false otherwise.
So all you have to do is
How to fix Ruby error: `require': cannot load such file -Programing Ruby 1.9 & 2.0 4th edition
gserver used to be part of Ruby's standards library for some time. However, it was removed from the standards library with Ruby 2.2.0 since it was basically unmaintained and had no tests.
This (un-)maintenance status has not really changed since. If you still need the functionality of the library, you can install and use the
gserver gem which contains the code state as it was removed form the standards library. However, I would strongly recommend to use something else instead...