Had this exact problem and it took a minute to figure it out.
Make sure you're running ruby -run -ehttpd . -p9001 from the correct location. You should be in {path_to_folder}/CreatingAClientServerTVMLApp/CreateTVMLApp/CreateTVMLApp. Note that there’s a second CreateTVMLApp in the path. Starting the server from the wrong location results in the useless “unexpected token” error when you run the app.
Also—this won’t break it but it’s probably not good to have—remove the trailing slash in the base URL in line 20 of AppDelegate. Otherwise it's looking for http://localhost:9001//application.js —two slashes between host:port and application.js.
(This is old, but answering anyway in case someone else lands here on a Google search.)