2010-05-10 6 views
0

J'ai reçu une erreur 500 interne Sever lorsque j'essaie de déployer mon application rails sur heroku. Cela fonctionne bien sur ma machine locale, donc je ne suis pas sûr de ce qui ne va pas ici. Semble être quelque chose avec les "sessions" sur le contrôleur de la maison. Voici mon journal:Erreur de serveur interne Heroku Rails

==> production.log <== 
# Logfile created on Sun May 09 17:35:59 -0700 2010 

Processing HomeController#index (for 76.169.212.8 at 2010-05-09 17:36:00) [GET] 

ActiveRecord::StatementInvalid (PGError: ERROR: relation "sessions" does not ex 
ist 
:    SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc, a 
.attnotnull 
       FROM pg_attribute a LEFT JOIN pg_attrdef d 
       ON a.attrelid = d.adrelid AND a.attnum = d.adnum 
      WHERE a.attrelid = '"sessions"'::regclass 
       AND a.attnum > 0 AND NOT a.attisdropped 
      ORDER BY a.attnum 
): 
    lib/authenticated_system.rb:106:in `login_from_session' 
    lib/authenticated_system.rb:12:in `current_user' 
    lib/authenticated_system.rb:6:in `logged_in?' 
    lib/authenticated_system.rb:35:in `authorized?' 
    lib/authenticated_system.rb:53:in `login_required' 
    /home/heroku_rack/lib/static_assets.rb:9:in `call' 
    /home/heroku_rack/lib/last_access.rb:25:in `call' 
    /home/heroku_rack/lib/date_header.rb:14:in `call' 
    thin (1.2.7) lib/thin/connection.rb:76:in `pre_process' 
    thin (1.2.7) lib/thin/connection.rb:74:in `catch' 
    thin (1.2.7) lib/thin/connection.rb:74:in `pre_process' 
    thin (1.2.7) lib/thin/connection.rb:57:in `process' 
    thin (1.2.7) lib/thin/connection.rb:42:in `receive_data' 
    eventmachine (0.12.10) lib/eventmachine.rb:256:in `run_machine' 
    eventmachine (0.12.10) lib/eventmachine.rb:256:in `run' 
    thin (1.2.7) lib/thin/backends/base.rb:57:in `start' 
    thin (1.2.7) lib/thin/server.rb:156:in `start' 
    thin (1.2.7) lib/thin/controllers/controller.rb:80:in `start' 
    thin (1.2.7) lib/thin/runner.rb:177:in `send' 
    thin (1.2.7) lib/thin/runner.rb:177:in `run_command' 
    thin (1.2.7) lib/thin/runner.rb:143:in `run!' 
    thin (1.2.7) bin/thin:6 
    /usr/local/bin/thin:20:in `load' 
    /usr/local/bin/thin:20 

Rendering /disk1/home/slugs/155328_f2d3c00_845e/mnt/public/500.html (500 Interna 
l Server Error) 

Et voici mon home_controller.rb

class HomeController < ApplicationController 
    before_filter :login_required 

    def index 
     @user = current_user 
     @user.profile ||= Profile.new 
    @profile = @user.profile 
    end 

end 

-t-il quelque chose de la façon dont mes itinéraires sont mis en place? Ou est-ce mon authentification? (J'utilise l'authentification reposante avec Bort)

Répondre

8

Votre application semble rechercher une table de sessions.

Avez-vous exécuté toutes vos migrations?

Parfois, il peut être utile d'utiliser heroku db: appuyez sur pour vous assurer que votre base de données est la même localement et à distance.

2

On dirait que vous avez oublié de heroku rake db:migrate

1

En outre, heroku rake db:sessions:create. Créez votre table de sessions.

Migrez également. heroku rake db:migrate À la votre! :)

Questions connexes