Topic: I accidentally deleted index.html (Ruby)

I am using Ruby v 3.0.3. Windows (for now)

I installed Ruby and Rails correctly on my computer. The localhost:3000 was working correctly, but along the way, I deleted my index.html file from Sublime Text 2. Now I am unable to connect to the WEBrick server when trying to start a new application. Is there a way I can restore index.html or do I have to start completely over? I am getting this error

Re: I accidentally deleted index.html (Ruby)

You can create another html file, name it 'index.html' and put in the public folder where there was the deleted file. Anyway, usually this default page is deleted as you will implement your own 'home page' where you will land at start up.
Another way, if anyway you'd like to have it exactly the same, just create a new rails application aside, copy-paste its 'index' page to your application and enjoy.

Last edited by Javix (2013-01-25 11:51:07)

Re: I accidentally deleted index.html (Ruby)

Thank you Javix for taking the time to answer. You really helped me a lot!!

Re: I accidentally deleted index.html (Ruby)

Anytime you go "oops, I deleted that default file", just run a scaffold with a different name or create another app. Quick to fix. We have all done it.

You can always run "rails destroy" instead of "rails generate" to remove your dummy scaffold or whatever afterwards.

Learning rails, one day at a time.

http://keilmiller.com

Re: I accidentally deleted index.html (Ruby)

Thank you Javix for taking the time to answer