I've just deployed a Rails app I'm working on to Heroku - http://sports-site.herokuapp.com/.
Here's the updated GitHub - https://github.com/adamzerner/sports_site.
application-*.css
andapplication-*.js
both are empty in production, but the CSS and JS work perfectly in development.Almost every page I visit (except the home page and the madden rankings page) give me a 500 error. And the logs are hardly giving me any information. Below is all I get:
2014-09-09T21:34:09.019757+00:00 heroku[router]: at=info method=GET path="/spurs" host=pure-everglades-8286.herokuapp.com request_id=d6a0348f-db82-4519-844d-d85973c75413 fwd="67.86.210.96" dyno=web.1 connect=1ms service=11ms status=500 bytes=1002 2014-09-09T21:34:09.323769+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=pure-everglades-8286.herokuapp.com request_id=934ea050-cbab-4c26-b925-5bc5f2d16369 fwd="67.86.210.96" dyno=web.1 connect=1ms service=9ms status=500 bytes=858
How can I solve these two issues?
Edit: I think these two issue might be related. When I open up Chrome's dev tools and go to the resources tab, It says:
Failed to load resource: the server responded with a status of 500 (Internal Server Error
underneath
<link data-turbolinks-track="true" href="/assets/application-1babc5fe447a141359d73e5a3339663c.css" media="all" rel="stylesheet" />
and
<script data-turbolinks-track="true" src="/assets/application-f3556e3d9d239b5384897deb4b41e10f.js"></script>
Edit:
When I go to http://sports-site.herokuapp.com/trailblazers/lamarcus_aldridge I get this error.
undefined method `name' for nil:NilClass
referring to this line
<h1><%= @player.name %> <small><%= link_to "#{@player.team.location} #{@player.team.name}", "/#{@player.team.name.downcase}" %></small></h1>
I don't understand why this is happening. I don't know if it's saying player
is nil
or team
is nil
, but neither seems to be according to this console output:
`2.1.2 :001 > l = Player.where("name like ?", "%lamarcus_aldridge%")[0]
Player Load (14.8ms) SELECT "players".* FROM "players" WHERE (name like '%lamarcus_aldridge%')
=> #<Player id: 383, team_id: 29, position_id: 4, position_rank: 2, overall_rank: 6, analysis: "Star player.|\n\tGood size and strengt
.
.
.
2.1.2 :002 > l.name
=> "LaMarcus Aldridge"
2.1.2 :003 > l.team.name
Team Load (0.4ms) SELECT "teams".* FROM "teams" WHERE "teams"."id" = ? LIMIT 1 [["id", 29]]
=> "Trailblazers"`