Ask coding questions

← Back to all posts
Saving Program
MatthewMoore (0)

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.

Commentshotnewtop
vedprad1 (733)

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!

theangryepicbanana (879)

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

vedprad1 (733)

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

theangryepicbanana (879)

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