Take a look at colorize gem
Install the gem and you can use colorize
method to specify the color you want
require 'colorize'
puts "This is blue".colorize( :blue )
Or you can simply use the codes as you would in bash
for eg:
def make_color(str, color)
colors = {:red => 31, :green => 32, :blue => 34}
puts "\e[#{colors[color]}m #{str}\e[0m"
end