I am doing prep work for App Academy but I am having a hard time setting up files/directories to be able to run everything correctly. I have a couple questions and haven’t been able to find concrete answers:
- How do you make a directory in the windows terminal?
- How do you run files previously written in Notepad in IRB? I wrote some simple scripts in Notepad because Sublime was causing me severe migraines. Or how do you change Notepad files to Ruby files?
- How do you create new files in IRB like
test_code.rb?
1) When at the Windows command prompt and having navigated to your working directory, type
md directory_name2) Unless you have specifically told notepad otherwise, notepad will have saved your file as a
.txtfile. You will simply have to rename the file extension from*.txtto*.rb.3) When you installed Ruby on your Windows machine, the Ruby interpreter would have undoubtably been added to your path, so you should just be able to run your
*.rbfile direct from the windows cmd prompt and it will execute.To load it while in IRB: Make sure you run IRB from the same folder as your
*.rbfile is in. Once you have cranked up an IRB session, typeload 'my_file.rb'.