Ask coding questions

← Back to all posts
How do I create new files?
kent05 (0)

If I deleted the main.rb file and try creating new files I get an error message which states something like main.rb is not found.

Coder100 (19277)

Replit only runs main.rb. You will have to configure the run button to run something other than main.rb:

FloCal35 (689)

Use the history icon by the name in the top left and scroll down to before you deleted it

kent05 (0)

@FloCal35 I don't understand what you mean could you please explain in details.

CodeMaster007 (123)

When you open your program, you should see the console on the right side, and to the left, a spot to code. The console is in a shade of black and the “spot to code” is gray-white. Just to the left of the “spot to code”, you should see a navigation bar type thing with these icons in order…
1. A paper with its upper left corner folded down into a 45 degrees angle
2. A 3D box
3. 3 coins stacked on top of each other
4. A check mark
So when you see these icons, click on the first one. This will lead you to a spot where you can see all the files in your program. There will be two options at the top of the new navigation panel. On the right side there should be a option to create a file and the other is a folder. Click on the “create file” button and rename it to anything you would like. Since you are using ruby on the program attached, end the file name with a “.rb”. I’m really not sure if this is what your looking for but hopefully this helps! @kent05

kent05 (0)

@CodeMaster007 Yeah I created the file and if I deleted the main.rb file that's when I get the problem.

CodeMaster007 (123)

Well, if you deleted it, then it’s pretty much gone. The only way to really get it back, is to go the replit document revision thing.

When you open it, you should be able to see all the times the repl was modified and from there, you can select the document when you still had the file. This will erase all the new data that came after you deleted the “.rb” file so keep that in mind. @kent05