ruby-on-rails – ActionView :: MissingTemplate

ruby-on-rails – ActionView :: MissingTemplate,第1张

概述在将mysite部署到VPS后,我遇到了这个运行时错误.请注意,在我的本地机器上,每件事都运行正常. 当我尝试通过控制器路径访问任何视图时,请说PostsController #index 我收到了这个错误 Completed 500 Internal Server Error in 3msActionView::MissingTemplate (Missing template posts/i 在将mysite部署到VPS后,我遇到了这个运行时错误.请注意,在我的本地机器上,每件事都运行正常.

当我尝试通过控制器路径访问任何视图时,请说postsController #index

我收到了这个错误

Completed 500 Internal Server Error in 3msActionVIEw::MissingTemplate (Missing template posts/index,application/index with {:handlers=>[:builder,:erb],:formats=>[:HTML],:locale=>[:en]}. Searched in:"/home//dev..com/releases/20120413023845/app/vIEws"):app/controllers/posts_controller.rb:7:in `index'

我认为haml是问题的原因,但我还不确定.

我添加了haml宝石并捆绑了我的应用程序

gem 'haml'  gem 'haml-rails'

更新:

当我将index.HTML.haml更改为index.HTML.erb并评论其工作的模板内容时,它忽略了application.HTML.haml布局而没有错误.

我注意到当cap命令运行时,应用程序没有编译我的hamls

RAILS_ENV=production RAILS_GROUPS=assets assets:precompileCompiled application.Js  (1ms)  (pID 15420)Compiled application.CSS  (1ms)  (pID 15420)Compiled application.Js  (1ms)  (pID 15420)Compiled application.CSS  (1ms)  (pID 15420)

这是否意味着我有资产管道管理的haml转换器的问题?如何告诉rails在生产环境中处理haml.

这是我的生产宝石版本

Using rake (0.9.2.2) Using i18n (0.6.0) Using multi_Json (1.2.0) Using activesupport (3.2.3) Using builder (3.0.0) Using activemodel (3.2.3) Using erubis (2.7.0) Using journey (1.0.3) Using rack (1.4.1) Using rack-cache (1.2) Using rack-test (0.6.1) Using hike (1.2.1) Using tilt (1.3.3) Using sprockets (2.1.2) Using actionpack (3.2.3) Using mime-types (1.18) Using polyglot (0.3.3) Using treetop (1.4.10) Using mail (2.4.4) Using actionmailer (3.2.3) Using arel (3.0.2) Using tzinfo (0.3.33) Using activerecord (3.2.3) Using activeresource (3.2.3) Using highline (1.6.11) Using net-ssh (2.3.0) Using net-scp (1.0.4) Using net-sftp (2.0.5) Using net-ssh-gateway (1.1.0) Using cAPIstrano (2.11.2) Using chunky_png (1.2.5) Using coffee-script-source (1.3.1) Using execJs (1.3.0) Using coffee-script (2.2.0) Using rack-ssl (1.3.2) Using Json (1.6.6) Using rdoc (3.12) Using thor (0.14.6) Using railtIEs (3.2.3) Using coffee-rails (3.2.2) Using fssm (0.2.9) Using sass (3.1.15) Using compass (0.12.1) Using compass-rails (1.0.1) Using haml (3.1.4) Using haml-rails (0.3.4) Using hpricot (0.8.6) Using MysqL2 (0.3.11) Using bundler (1.1.3) Using rails (3.2.3) Using sexp_processor (3.1.0) Using ruby_parser (2.3.1) Using sass-rails (3.2.5) Using uglifIEr (1.2.4)
@R_419_6120@ 可能是你的

gem 'haml'

不在生产组中(或者,不在开发组之外)

总结

以上是内存溢出为你收集整理的ruby-on-rails – ActionView :: MissingTemplate全部内容,希望文章能够帮你解决ruby-on-rails – ActionView :: MissingTemplate所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/1282934.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-09
下一篇2022-06-09

发表评论

登录后才能评论

评论列表(0条)

    保存