Ruby in sublime text editor


#1

I am trying to run Ruby code in sublime text editor 3 but it won’t run and is throwing this error. Any idea why?

‘ruby’ is not recognized as an internal or external command,
operable program or batch file.
[Finished in 0.1s with exit code 1]

Code I ran:
def foobar
“hello world”
end

puts foobar


#2

@nishankjain170861360
Try adding the Ruby bin folder path to environment variables and execute the file with command ruby filename.rb


#3

thanks. I re-installed ruby and now it works