500 internal server error when I try to push my app onto Heroku

試著忘記壹切 提交于 2019-12-04 18:39:35

So based upon the heroku info that you provided I see that you are on the bamboo stack and that stack does not support Rails 3.1+. Only the cedar stack supports Rails 3.1+. You'll need to use the following command to create a new app on the cedar stack:

heroku create --stack cedar

This is the result of your stylesheets not being compiled. Heroku will attempt to run

rake assets:precompile

before deploying your app. If the precompile command fails it will fail silently for now. I actually have an open issue for this on Heroku

https://github.com/heroku/heroku-buildpack-ruby/issues/9

The most likely cause is that the Rakefile is trying to load (or access) a gem. Heroku buildpacks attempt to compile the stylesheets before they have access to the gemset so any requires will fail. The best way to avoid this is to wrap those requires in your Rakefile in environment specific conditionals:

if Rails.env == 'development' || Rails.env == 'test'
  require 'somegem1'
  require 'somegem2'

  # whatever code is being used by those gems goes in this block
end
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!