It cannot because your second match is evaluated *before* gsub starts its work. So the value passed as second argument to gsub can never change.
How can i do, for get correct urls?
The question is: what do you want to achieve with the code? It looks like you want to replace valid URL's with "false" and invalid URL's with "true". That does not seem reasonable to me but if you want to do that you can use the block form of gsub like this:
"http://ale.it".gsub(/http[s]?://[^\s]+/) do |m|
(m =~ URI::regexp).nil?.to_s
end