Run ruby scripts inside command prompt in windows

First you need to install ruby inside you windows system. I am assuming you have have already installed it.In place command prompt you can install ComEmu from

1. Now create a folder inside you drive and place your ruby scripts inside it.


mkdir ruby_scripts

cd ruby_scripts

Simplest Ruby scripts is:

#!/usr/bin/env ruby

print "Enter name? "
name = gets.chomp 
puts "your #{name}!"

and save this script in sample.rb inside ruby_scripts folder. Now, run the ruby script using

ruby sample.rb

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s