2012-12-11 58 views
1

我的應用程序的工作我的本地服務器上,但是當我把它上傳到Heroku的,我得到一個網頁,上面寫着:"We're sorry, but something went wrong."爲什麼只有在嘗試將應用程序上傳到Heroku時纔會出現ActionView :: Template :: Error?

當我看着Heroku的日誌,我看到一個錯誤行:

ActionView::Template::Error (/app/app/assets/stylesheets/application.css has already been required) 

如果我的應用程序在我的本地環境中正常工作,這是什麼意思?有關如何解決此問題的任何建議?

對於它的價值,我的Gemfile看起來像這樣:

source 'https://rubygems.org' 

gem 'rails', '3.2.8' 
gem 'bootstrap-sass' 
gem 'bcrypt-ruby', '3.0.1' 
gem 'json' 
gem 'ruby-fs-stack' 


group :development, :test do 
    gem 'sqlite3', '1.3.5' 
    gem 'rspec-rails', '2.11.0' 
end 

# Gems used only for assets and not required 
# in production environments by default. 
group :assets do 
    gem 'sass-rails', '3.2.5' 
    gem 'coffee-rails', '3.2.2' 
    gem 'uglifier',  '1.2.3' 
end 

gem 'jquery-rails', '2.0.2' 

group :test do 
    gem 'capybara', '1.1.2' 
    gem 'factory_girl_rails', '4.1.0' 
end 

group :production do 
    gem 'pg', '0.12.2' 
end 

這裏是Heroku的日誌:

2012-12-11T18:10:43+00:00 app[web.1]: Processing by StaticPagesController#home as HTML 
2012-12-11T18:10:43+00:00 app[web.1]: Rendered static_pages/home.html.erb within layouts/application (11.4ms) 
2012-12-11T18:10:43+00:00 app[web.1]: Completed 500 Internal Server Error in 131ms 
2012-12-11T18:10:43+00:00 app[web.1]: 
2012-12-11T18:10:43+00:00 app[web.1]:  9:  
2012-12-11T18:10:43+00:00 app[web.1]:  11: <%= javascript_include_tag "application" %> 
2012-12-11T18:10:43+00:00 app[web.1]: ActionView::Template::Error (/app/app/assets/stylesheets/application.css has already been required): 
2012-12-11T18:10:43+00:00 app[web.1]:  8: <meta name="author" content=""> 
2012-12-11T18:10:43+00:00 app[web.1]:  12: <%= csrf_meta_tags %> 
2012-12-11T18:10:43+00:00 app[web.1]: 
2012-12-11T18:10:43+00:00 app[web.1]: app/views/layouts/application.html.erb:10:in `_app_views_layouts_application_html_erb__2962376498821052289_32805880' 
2012-12-11T18:10:43+00:00 app[web.1]: 
2012-12-11T18:10:43+00:00 app[web.1]:  7: <meta name="description" content=""> 
2012-12-11T18:10:43+00:00 app[web.1]:  13: <%= render 'layouts/shim' %> 
2012-12-11T18:10:43+00:00 app[web.1]:  10: <%= stylesheet_link_tag "application", :media => "all" %> 
2012-12-11T18:10:43+00:00 heroku[router]: at=info method=GET path=/ host=obscure-mesa-7065.herokuapp.com fwd=75.165.254.103 dyno=web.1 queue=0 wait=1ms connect=4ms service=257ms status=500 bytes=643 

回答

0

我不知道爲什麼它工作在本地主機上,但似乎你有一個循環依賴。

轉到app/assets/stylesheets,並檢查application.css.scss的頭文件,然後檢查它所需的所有文件的頭文件,以確保它們都不引用application.css.scss。

+0

嗯......我沒有看到任何對application.css.scss的引用,但是我在@個樣式表的頂部有@import「bootstrap」;''。這可能會導致問題嗎? – 2scottish

+0

它看起來像我的兩個樣式表引用'@import「bootstrap」;'。當我刪除其中一個參考文獻時,它工作正常。謝謝你的幫助! – 2scottish

相關問題