Check sum of all primes under two million
Ruby favours Functional Programming, let me show you an example.

def prime?(n)
  limit = Math.sqrt(n).to_i + 1
  (2..limit).all? { |i| n % i != 0 }
end


This improves readability as the code makes use of all? to implicitly loop (Instead you looped explicitly) and is faster as the limit is the sqrt of n and not n and all? short-circuits (returns as soon as one condition is false).



Also the second part would benefit from FP:

puts (2..2000000).select{ |n| prime?(n) }.inject(:+)


In general, in Ruby explicit looping is the exception and not the norm, as there are so many built-ins and shortcuts to make use of. 

Each function I made use of here is listed at The Ruby Enumerable Documentation and I warmly suggest studying in detail that page, it will take a bit of time, but the time you will save in the future by using it instead of reinventing the wheel each time will be more than worth it.