在ruby中,是否可以指定使用与运行原始脚本相同的ruby解释器来调用另一个ruby脚本?例如,如果a.rb运行b.rb几次,是否可以替换system("ruby","b.rb","foo","bar")用类似的东西run_ruby("b.rb","foo","bar")所以如果你使用ruby1.9.1a.rb在原件上,ruby1.9.1将在b.rb上使用,但如果您只使用rubya.rb在原件上,ruby会用在b.rb上吗?我不想使用shebang,因为我希望它能够在不同的计算机上运行,其中一些没有/usr/bin/env.编辑:我不是说load或require等等,但
选择有意义。但是有人可以向我解释.detect吗?我不明白这些数据。>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,4)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,6)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(3,7)}=>3>>[1,2,3,4,5,6,7].detect{|x|x.between?(2,7)}=>2>>[1,2,3,4,5,6,7].detect{|x|x.between?(1,7)}=>1>>[1,2,3,4,5,6,7].detect{|x