1

按照这个https://github.com/yeoman/generator-ember教程使用 EmberJS 和 Yeomane,运行grunt server浏览器后是空白的。

我希望看到此页面,但没有显示任何内容:![在此处输入图像描述][1]

更新:

控制台错误:

 Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/styles/style.css
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/jquery/jquery.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/handlebars/handlebars.runtime.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/ember/ember.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/ember-data-shim/ember-data.js
Uncaught ReferenceError: Ember is not defined compiled-templates.js:1
Uncaught ReferenceError: Ember is not defined combined-scripts.js:3
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/affix.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/alert.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/dropdown.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/tooltip.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/modal.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/transition.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/button.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/popover.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/carousel.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/scrollspy.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/collapse.js
Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/bower_components/bootstrap-sass/js/tab.js

更新 2:

works-Mac:myemberapp1 work$ grunt server
Running "server" task

Running "clean:server" (clean) task

Running "replace:app" (replace) task
Replace app/index.html -> .tmp/index.html

Running "concurrent:server" (concurrent) task

    Running "emberTemplates:dist" (emberTemplates) task
    File ".tmp/scripts/compiled-templates.js" created.

    Done, without errors.

    Running "compass:server" (compass) task

    Done, without errors.

Running "neuter:app" (neuter) task

Running "connect:livereload" (connect) task
Started connect web server on localhost:9000.

Running "open:server" (open) task

Running "watch" task
Waiting...
4

2 回答 2

4

对于特定的错误Failed to load resource: the server responded with a status of 404 (Not Found) http://localhost:9000/styles/style.css,您还应该检查您是否compass安装了服务器。那是:

gem install compass

要检查 compass 是否正确运行,请运行grunt serve --verbose并检查输出是否有任何错误,例如:

in `to_specs': Could not find compass (>= 0) amongst [...] (Gem::LoadError)
于 2014-01-28T01:06:41.623 回答
3

脚手架完成后,您必须运行命令bower installnpm install安装所需的包(在bower.jsonpackage.json文件中描述。在此之后,grunt 将能够提供依赖项。

在构建项目并使用引入新依赖项时,您将通过编辑bower.json和/或package.json文件并重新运行安装来添加它们。下载的包通常不存储在源代码管理中。

于 2013-12-28T00:48:43.337 回答