What are the paths that “require” looks up by default?
问题 In Ruby, I have been told that when doing require "some_file" Ruby will look for the file in certain places. I know that it looks for some_file.rb , but where does it look for it by default? 回答1: It depends on your platform, and how Ruby was compiled, so there is no "the" answer to this. You can find out by running: ruby -e 'puts $:' Generally, though, you have the standard, site, and vendor Ruby library paths, including an arch, version, and general directory under each. 回答2: Ruby looks in