2012-04-13 12 views
4

mysiteをVPSにデプロイした後、このランタイムエラーに直面しています。私のローカルマシンでは、すべてのことがうまく動作していることに注意してください。ActionView :: MissingTemplate

私は、コントローラ経路を介して任意のビューにアクセスしようとPostsControllerの番号インデックスに

を言うことができます私はHAMLが問題の原因であるが、私は確認していないことを考えています。このエラーに

Completed 500 Internal Server Error in 3ms 
ActionView::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の宝石を追加し、私のアプリをバンドル

gem 'haml' 
    gem 'haml-rails' 

更新:

私はindex.html.erbするindex.html.hamlを変更し、それが動作テンプレートの内容をコメントしたが、それは無視application.html.hamlレイアウトでエラーが発生することはありません。

私は、アプリケーションが時にキャップコマンドの実行

RAILS_ENV=production RAILS_GROUPS=assets assets:precompile 

Compiled application.js (1ms) (pid 15420) 
Compiled application.css (1ms) (pid 15420) 
Compiled application.js (1ms) (pid 15420) 
Compiled application.css (1ms) (pid 15420) 

私hamlsをコンパイルdidnotことに気づいたこれは、私は、資産パイプラインによって管理されているHAMLコンバータに問題がある意味ですか?どのように私は生産環境で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) 
+0

どのようにrailsアプリケーションを実行していますか? VPS? webrick? apache? nginx?要求がレールルーティングに達する前にどのように処理されているかと関係があるかもしれません。 – Saifis

+0

私はapacheを使用しています。ハンドラー=> [:builder、:erb]にはhamlが含まれていないため、この問題が考えられますか?はいの場合、どのようにハンドラーリストにhamlを追加できますか? – aaalsubaie

+0

http://stackoverflow.com/questions/6227945/rails-3-not-loading-haml-handlerこれはあなたの問題に似ています。 – Saifis

答えて

7

があなたの

gem 'haml' 

かもしれませあるが、生産グループに属していない(または、開発グループの外ではありません)

+0

Gemfileのプロダクショングループにhaml gemを追加すると、私のために働きました。 Heroku環境でエラーが発生しました。 – Elliott

0

'は宝石をチェックhaml-rails 'in:productionグループのGemfileにもあります

関連する問題