我的应用程序在我的本地服务器上运行,但当我将其上传到Heroku时,我会看到一个页面:"We're sorry, but something went wrong."
当我查看Heroku Logs时,我看到一个错误行:
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 :(得分:0)
我不知道为什么它适用于localhost,但似乎你有一个循环依赖。
转到app / assets / stylesheets并检查application.css.scss的标题,然后检查所需的所有文件的标题,以确保它们都不引用application.css.scss。