2014-04-27 196 views
1

我寫了一個RoR應用程序並試圖部署它。HAML和ERB渲染問題

因此,我的Linode上出現以下問題: 瀏覽器頁面顯示的只是我在index.html.haml中編寫的代碼,而不是假定的頁面。 當我嘗試使用index.html時,我得到一個有效的呈現頁面。 當我嘗試使用index.html.erb它呈現部分(東西,例如輸入,呈現,但有很多字符串的erb代碼,沒有css)

同時,我的本地服務器(基於OS X)效果很好,我將我的基於haml的頁面看作普通的呈現html頁面。 (我越來越堅果!)

請幫我理解如何解決這個問題。

的Ubuntu 12.04,阿帕奇2.22,紅寶石2.0.0,軌3.2.12,HAML 4.0.5,HAML護欄0.4

提前感謝!

UPD 的Gemfile

source 'https://rubygems.org' 

gem 'rails', '3.2.12' 

# Bundle edge Rails instead: 
# gem 'rails', :git => 'git://github.com/rails/rails.git' 

gem 'mysql2' 
gem 'devise', '3.0.3' 
gem 'debugger' 


group :assets do 
    gem 'coffee-rails', '~> 3.2.1' 
    gem 'uglifier', '>= 1.0.3' 
    gem 'therubyracer', :platform => :ruby 
end 

gem 'less-rails', '~> 2.2.6' 
gem 'sass-rails', '~> 3.2.3' 
gem 'twitter-bootstrap-rails', '2.2.4' 
gem 'friendly_id', '~> 3.2' 

gem 'jquery-rails' 
gem 'haml', '~> 4.0.0' 
gem 'cancan' 
gem 'haml-rails' 
gem 'rails-i18n', '~> 3.0.0.pre' 
gem 'i18n-js' 
gem 'obscenity' 
gem 'thin' 
gem 'will_paginate-bootstrap' 
gem 'nifty-generators', :group => :development 
gem 'rails_12factor' 
gem 'mocha', :group => :test 

group :development do 
    gem 'sqlite3' 
    gem 'capistrano', '2.15.5' 
    #gem 'capistrano-rails' 
    #gem 'capistrano-bundler' 
    #gem 'capistrano-rvm' 
    #gem 'rvm1-capistrano3', :require => false 
end 

gem 'net-ssh', '2.7.0' 

gem 'foreman' 

Apache的配置

<VirtualHost *:80> 
    # Admin email, Server Name (domain name), and any aliases 
    ServerAdmin [email protected] 
    ServerName www.mysite.com 
    ServerAlias mysite.com 
    Options Indexes ExecCGI FollowSymLinks 
    PassengerResolveSymlinksInDocumentRoot on 
    RailsEnv production 
    RailsBaseURI/

    # Index file and Document Root (where the public files are located) 
    DirectoryIndex index.html index.php index.html.erb index.html.haml 
    DocumentRoot /home/deploy/public/mysite.com/public/app/views/home 

    # Log file locations 
    LogLevel warn 
    ErrorLog /home/deploy/public/mysite.com/log/error.log 
    CustomLog /home/deploy/public/mysite.com/log/access.log combined 
</VirtualHost> 
+0

瘦是'原樣'即我沒有修改默認配置,Apache也沒有火箭科學,將在一秒內發佈其配置 – Maria

回答