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

Comments
hotnewtop
CodingCactus (4355)

If you want to run a file other than main.rb, you should look into using a .replit file https://docs.replit.com/repls/dot-replit

basically make a file called .replit and write:

run="ruby filename.rb"
language="ruby"
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>