るりまサーチ (Ruby 3.3)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.040秒)
トップページ > 種類:インスタンスメソッド[x] > クラス:LoadError[x] > バージョン:3.3[x] > クエリ:file[x] > ライブラリ:ビルトイン[x]

別のキーワード

  1. _builtin file?
  2. _builtin file
  3. base file
  4. file open
  5. file path

検索結果

LoadError#path -> String | nil (49.0)

Kernel.#require や Kernel.#load に失敗したパスを返します。

...Kernel.#require や Kernel.#load に失敗したパスを返します。

begin
require 'this/file/does/not/exist'
rescue LoadError => e
e.path # => 'this/file/does/not/exist'
end

パスが定まらない場合は nil を返します。...