【问题标题】:yeoman generator-ember doesn't show anything in browseryeoman generator-ember 在浏览器中不显示任何内容
【发布时间】:2013-12-27 03:44:27
【问题描述】:

按照这个 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...

【问题讨论】:

  • 您在控制台中看到了什么错误?
  • @kingpin2k 重新更新。
  • 您在运行 grunt 的终端窗口中看到任何消息吗?
  • @SteveH。只需使用终端窗口再次更新即可。
  • 你做过bower installnpm install吗?

标签: ember.js yeoman yeoman-generator


【解决方案1】:

对于特定错误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)

【讨论】:

    【解决方案2】:

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

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

    【讨论】:

      猜你喜欢
      • 2014-03-13
      • 2017-02-07
      • 2014-10-29
      • 2018-11-09
      • 1970-01-01
      • 2011-02-19
      • 1970-01-01
      • 2018-03-19
      • 1970-01-01
      相关资源
      最近更新 更多