Actually found the answer to the English version
require 'rubygems' require 'active_support/all' def random_hour(from, to) (Date.today + rand(from..to).hour + rand(0..60).minutes).to_datetime end puts random_hour(10, 15)
The question is how to understand the principle of work require I know. The question is, why connect it, what is it? \
require 'rubygems' require 'active_support/all'
When compiling this code gives
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- active_support/all (LoadError) from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require' from C:/Users/###/Desktop/RubyProg/OlympProb/2.6/reshenie.rb:6:in `<top (required)>'
ruby -e 'puts rand(0..24).to_s + ":" + rand(0..60).to_s'
. And deal with gems if you want to cut. - KoVadim