我是絕對的Ruby初學者。我創建了一個小紅寶石文件,運行命令ruby "methods.rb"
時運行良好。這意味着我在正確的目錄中。需要無法找到紅寶石文件
但是當我啓動IRB和運行命令require "methods.rb"
,我得到如下回應:
LoadError: cannot load such file -- methods.rb
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:53:in `require'
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:53:in `require'
from (irb):1
from /usr/local/rvm/rubies/ruby-1.9.3-p392/bin/irb:16:in `<main>'