Reputation: 103
I'm having a really bad day at this: #rails-noob #githubsucks #herokufail #abouttosmashmylaptop. Ok, I feel better.
I have created an app using Rails 3.2.12/ruby 1.9.3. It's working locally - no issues at all - and I've saved locally with github, although I'm having some github.com issues (see this question Git duplication - receive pack not found). So I tried to deploy to Heroku locally, i.e. not via github.com. It seems to work - there are no obvious issues, but then when I try to actually open the application (i.e. browse the website) I get the infamous "We're sorry, but something went wrong". Here's what I've tried so far:
I’ve checked Heroku logs etc. multiple times, and there’s no issues – everything looks fine - except that there's a 500-error. From what I've read it seems there might have previously (pre-Rails 4.0) been a Heroku issue driving these errors, but I can't seem to find reference to either a. it being fixed, or b. how to fix it.
Suggestions?
UPDATE: As per culix's suggestion, I tried to turn on the log level although but it doesn't seem to change the log output (time codes removed).
app[web.1]: Started GET "/" for 124.148.153.24 at 2013-08-11 07:30:40 +0000
app[web.1]: Processing by StaticPagesController#splash as HTML
app[web.1]: Rendered static_pages/splash.html.erb within layouts/application (2.6ms)
heroku[router]: at=info method=GET path=/ host=genericappname.herokuapp.com fwd="124.148.153.24" dyno=web.1 connect=2ms service=1470ms status=500 bytes=643
app[web.1]: Completed 500 Internal Server Error in 1459ms app[web.1]: ActionView::Template::Error (undefined method `[]' for nil:NilClass
app[web.1]: (in /app/app/assets/stylesheets/application.css)):
app[web.1]: 2:
app[web.1]: 3:
app[web.1]: 4: <%= full_title(yield(:title)) %>
app[web.1]: 5: <%= stylesheet_link_tag "application", :media => "all" %>
app[web.1]: 6: <%= javascript_include_tag "application" %>
app[web.1]: 7: <%= csrf_meta_tags %>
app[web.1]: 8: <%= render 'layouts/shim' %>
app[web.1]: app/v
However, when I was pushing changes back to Heroku I did pick up two issues:
Related, or an entirely new problem?
UPDATE 2: In response to some comments/questions:
I’m struggling with lack of Heroku error info to guide me, so directions in that regard welcome also.
UPDATE 3: After running 'run rake assets:precompile' I got a whole heap of Deprecation warnings, along the lines of:
You have Rails 2.3-style plugins in vendor/plugins! Support for these plugins will be removed in Rails 4.0. Move them out and bundle them into your gemfile.
But my vendor/plugins folder is empty?
I have also run 'rake assets:precompile --trace' (I learnt a new command!) and got the following around where the error occurs:
** Execute assets:precompile:primary
rake aborted!
/app/app/assets/stylesheets/application.css has already been required
/app/vendor/bundle/ruby/1.9.1/gems/sprockets-2.2.2/lib/sprockets/base.rb:267:in `circular_call_protection'
Upvotes: 1
Views: 1205
Reputation: 103
Ok, answering my own question in case someone else has a similar problem. Ultimately I had several issues related to the asset pipeline. Somewhere along the line in application.rb file I'd put in some wild card operators (*) in the line config.assets.precompile += %w( various file extensions)
, as per the answer to this question (bootstrap-sass: Undefined variable: "$baseLineHeight"). Once I removed these, I precompiled the assets again in development ($ RAILS_ENV=development rake assets:precompile
), and then pushed to git, then to heroku.
Along the way I also had some issues with heaps of warnings/errors from Webrick - I solved this by specifying the Webrick version in my gemfile:
group :development do
gem 'webrick', '~> 1.3.1'
end
If you're new to assets and deployment like me it's definitely worth reading both the RoR (http://guides.rubyonrails.org/asset_pipeline.html) and Heroku (https://devcenter.heroku.com/articles/rails-asset-pipeline) guides to the asset pipeline, as well as watching Ryan Bate's screencasts #278 and #341.
Upvotes: 1
Reputation: 487
Why do you think that error in assets?
You have ActionView::Template::Error, try to debug it, where you call an array on nil object or smthg else.
P.S. did you pass your migrations?
heroku run rake db:migrate
Upvotes: 0