Ask coding questions

← Back to all posts
I get a run main.rb file not found....but I deleted it why does it occur?
realquadrant (0)

I deleted main.rb

But now I get errors when I press the run button. I just want to run a specific ruby script. Why does this happen? Thanks

CodingCactus (4355)

If you want to run a file other than main.rb, you should look into using a .replit file

basically make a file called .replit and write:

run="ruby filename.rb"
Wumi4 (529)

The reason is because by default, Ruby Repls always runs main.rb. The file is basically an entry point. If you want to run it, then go to Shell tab, then type:

ruby <your_file_here.rb>