Problem running ruby script via cmd

No matter what kind of code a ruby script has.
Whenever I try to run it via cmd like this
ruby example.rb

The script won’t run and I get a weird response instead, which is the
number 6.

Has anyone experienced this before?

Here is a screenshot

I also tried running the script as administrator but it does not work.

Oh my god. This problem was so annoying and huge it caused my project to

Anyway I worked my way out of this. The reason was kind of stupid -__-

I had a ruby.rb file on desktop so whenever I ran “ruby” on cmd or “ruby
example.rb” while on desktop I’d get a number on the shell as it’s
response instead of sleeping or executing the script. Deleted the
ruby.rb from desktop and the problem is gone.