script/serverto run the app, which makes the application available at
http://localhost:someport. Later, in production it's usually
somedomain.com/. In both cases, the application is mounted at the root of the domain, which means links beginning with
<a href='/users'>Users</a>) which were inadvertently introduced will never break. Then, when someone then deploys your application to a non-root url like
mydomain.com/myappall hell breaks loose and you have a bunch of broken links.
As a preventive measure, it's wiser to both develop and run automated functional test suites (like a Selenium suite) with your application running on a non-root url. That way relative url bugs are caught early enough that nothing significant is affected.
Some ruby servers do indeed support this kind of mounting - but not all, I presume, so
script/serverdoes not support it. However, the popular mongrel server does allow this through the
--prefixoption. We've modified
script/serverto a more narrow
script/mongrelwhich accepts the
--prefixoption and always uses mongrel.
script/mongrelotherwise behaves like
script/serverin every respect.
Try it out - you can get it off GitHub from the script-mongrel project. If you're on Windows (or otherwise don't have git), don't worry - it's a single file plus the README. You can simply copy them off the repo browser.