我有两个 Ruby 脚本,我正在调用这些文件,但出现错误。
我有r1.rb
和r2.rb
。当我打电话时,r1.rb
我收到此错误:r2.rb
r3.rb
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- r1 (LoadError)
from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from r3.rb:1:in `<main>'
r1.rb 是:
def random
rand(1000000)
end
r2.rb 是:
def random
(rand(26) + 65).chr
end
r3.rb 是:
require 'r1'
require 'r2'
puts random