i'm new to programming and a couple of days ago i started a ruby course on codecademy. i found that instead of an ide, for ruby is usually used Sublime Text. the problem is that i can't run a simple program from the terminal of the mac by typing " ruby test.rb " (test is the name of the script). in another question in here said that it was enough, but not in my case. what can i do to run it ? here's the code anyway:)
print "Enter yout name: "
input = gets.chomp
Are you in the folder where the test file is? The steps to run a ruby program from terminal are:
cd foldernameuntil you've drilled down to where the file is. If you are unsure what is in the current folder, type
lsto list all files & folders.
lsagain and you should see
test.rb. The extension of the file should be .rb not .tb. Don't know if that's a type or not.
ruby test.rband your program should work. I mimicked your code and it runs on my Mac terminal.