Assuming I compile my own fresh Ruby (MRI 1.9.3), what is the default LOAD_PATH, and how is that computed?
How is the default Ruby LOAD_PATH determined?
4.6k Views Asked by Alex Gaynor At
2
There are 2 best solutions below
Related Questions in RUBY
- how to integrate cashfree payment gateway in ruby on rails project
- RSpec Capybara throwing Selenium error when trying to click a button with browser confirm
- Duplicate GET requests - Rails & Heroku
- convert csv file with json data inside to a column, rows table in 2nd csv file
- Installing dependencies from a gemspec file
- Verifying Google Identity OAuth2 token with Ruby
- Java code of AES/GCM/NoPadding encryption algorithm with authentication tag
- How to fix error in model with gem lockbox
- Cannot install Ruby Gem on Window
- use logstash filter ,aes gcm encrypted in ruby,but cannot decrypted in java
- In Rails 7, what is the right ActiveRecord callback to use if I need to prevent (or rollback) persistance on error?
- How can I go through an array and still remove elements from it
- Nokogiri only returning 5 results
- How do I get the fullscreen mode in firefox?
- undefined group option when using branch reset group regex in Ruby
Related Questions in REQUIRE
- ERR_REQUIRE_ESM Error When Refreshing the Page in NextJS with Nivo
- In node.js is there a way to reuse a list of const-require statements, in all files?
- Trying to import KcAdminClient
- Vitest cannot be imported in a CommonJS module using require()
- How to use the require function for dynamic image? The image source will be changed by AJAX request
- require() of ES Module \node_modules\string-width\index.js from \node_modules\wide-align\align.js not supported
- TypeError: _$$_REQUIRE(_dependencyMap[7], "(...)ssets-registry/path-support.js") is not a function (it is Object)
- Interesting error using a variable with required function inside a method in Vue.js
- which [Node Require] is the right way to use and why?
- How can I use require and import both in node.js?
- How to use "zypper info" with a specific version of a package
- Uncaught ReferenceError: require is not defined in React Vite in Production
- Hard-coded 'require' from a racket macro doesn't bind 'provided' identifiers
- Import nor require are working inside my jest test files in my node.js app
- TypeScript avoid TS2749 and avoid using typeof on classes imported using require (run using bun)
Related Questions in LOAD-PATH
- Rails system tests unable to load a lib file required in a model, file loads fine in development, how can I fix this?
- julia not finding "standard" packages (or LOAD_PATH)?
- Julia: JULIA_LOAD_PATH not defined when trying to set value
- Load path ivy-* match any series number
- How to use I18n in a Rails' helper via a frozen class string
- Understanding jinja2.Packageloader()
- How to mask an already installed Emacs package?
- how to distribute a ruby script via homebrew
- How do I use a module defined in lib/ folder of Phoenix project?
- How to configure RSpec to find specs in lib folder?
- Emacs initialization and load-path
- How does the emacs load the package?
- Loading files from a different partition
- gulp-sass work around for load_path support?
- emacs cannot load file highlight-current-line file-error
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
On my machine, the initial load path looks like this:
Armed with
grep, an investigation into the Ruby source leads to the definition ofruby_initial_load_paths[]inversion.c(this is on Ruby 1.9.3). The first of these that apply (neitherNO_INITIAL_LOAD_PATHorRUBY_SEARCH_PATHhave been set) isRUBY_SITE_LIB2. Looking at the defines above that definition we see:and in turn:
Following this chain of defines, it becomes clear that this corresponds to the first entry in my load path above. Similarly the other constants that go into this variable correspond to the other load path entries.
The
ruby_initial_load_paths[]variable is used inruby_init_loadpath_safe()inruby.c, where the actual load path is set up for the process.So the answer to your question is that the initial load path is set at compile time with some
#defines, according to how the build has been configured.