I’m starting right from the beginning with Ruby to learn the ropes but have a quick query. Currently I am writing small test bits of code such as:
puts 'Hello World'
etc. into EditRocket, saving as test1.rb and then opening Terminal on my Mac and executing the ‘program’ with:
ruby test1.rb
This is becoming a little tedious with the backwards and forwarding so I was wondering if there was a more ‘user friendly’ approach to writing a bit of Ruby code and then executing it live to get a result as you would SQL code in SQL Server for example?
Running irb in Terminal will run a Ruby read-eval-print loop that will evaluate each line of Ruby that you type. Just type “irb” in Terminal to start, and “exit” from within irb to exit.