Bumped into this error when trying to manually setup SharePoint 2013 pre requisite installation.
The Configuration stopped at step Configuring Application Server Role and Web Server (IIS) Role.
Resolution
- Go to Server Manager > Add Roles and Features
- Select Your server in the Server Pool under Server Selection page
- Select Web Server (IIS) Role
- Click Next until the wizard finishes
- Rerun the Pre-requisite setup and the error is gone.
When you at Add Roles and Features you must either remove or add new roles or features. How can you keep click Next? Do you mean remove IIS first and reinstall it?
Hi Allan, You can skip the Roles by clicking the “Feature” directly.

I tried your solution, but I still keep getting the error message. The prerequisites will not pass that point.
Tried that same error, I am running Server2012 R2 and trying to Install SharePoint 2013
Try this!
http://luiswu.wordpress.com/2014/05/09/install-sharepoint-2013-on-windows-server-2012-r2/
For those who are still facing problems, try this:
http://www.someshinyobject.com/posts/server-2012-r2-and-sharepoint-2013-the-tool-was-unable-to-install-application-server-role-web
Thanks Ahcheng. I added Application Server and Web Server role to my Windows Server 2012 R2 OS and the issue was resolved. Thanks again for the inputs