Skip to content
← Back to Community
Saving Program
Profile icon
MatthewMoore

In the introduction to programming, one of the first steps is to "save your program as first_program.rb". I do not, however, see any options to save and name a program.

Voters
Profile icon
Maria-Cassandr1
Profile icon
AnikaMenon1
Profile icon
DavidUkemenam
Profile icon
SamruddhiDeo
Profile icon
jfyjohn
Profile icon
Surajbhan12
Profile icon
DHANUSHRAORAO
Profile icon
AhilanArivarasu
Profile icon
MatthewMoore
Comments
hotnewtop
Profile icon
vedprad1

Repl.it automatically saves your file as main.rb, so you do not need to worry about that.

Unfortunately, you cannot change the name to first_program.rb. This is because repl.it has to run the file, not you. In real life, you would right ruby first_program.rb into the console, but you cannot do that on repl.it. That's why you can only run the file called main.rb.

There is one advantage to this, though. Instead of dealing with the command line, you just have to click run. You have to pay this cost though.

By the way, there is an error in your code. The first line (first_program.mc) should not actually be in your program. Delete that line.

If this answers your question, please check the checkmark on the left side of this message. Thanks and Good Luck!

Profile icon
theangryepicbanana

the program is already saved automatically, and you can rename your repl by clicking on the pencil icon next to the repl name in the top-left hand corner

Profile icon
vedprad1

@theangryepicbanana : Actually, you can only rename the repl, but not the file name, which is what he is asking.

Profile icon
theangryepicbanana

@vedprad1 oh well you can't actually do that on repl.it. it has to be called "main" otherwise it won't run