开发者

problem deploying RailsTutorial Chap 11 on Heroku

开发者 https://www.devze.com 2023-01-27 01:35 出处:网络
I\'m following the Rails Tutorial and just finished Chap 11.No errors on localhost, but a 500 on heroku. heroku logs (shown below) says \"relation \'microposts\' does not exist\" followed by some sql.

I'm following the Rails Tutorial and just finished Chap 11. No errors on localhost, but a 500 on heroku. heroku logs (shown below) says "relation 'microposts' does not exist" followed by some sql. I'm not sure what to do, given that localhost runs fine. Any ideas?

[sample_app (master)]$ heroku logs
开发者_Go百科==> production.log <==


Started GET "/" for 96.225.159.51 at Wed Nov 24 19:05:00 -0800 2010
  Processing by PagesController#home as HTML
Completed   in 18ms

ActiveRecord::StatementInvalid (PGError: ERROR:  relation "microposts" does not exist
:             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 = '"microposts"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum
):
  app/controllers/pages_controller.rb:6:in `new'
  app/controllers/pages_controller.rb:6:in `home'


==> dyno-2890282.log <==
DEPRECATION WARNING: railtie_name is deprecated and has no effect. (called from require at /usr/ruby1.8.7/lib/ruby/gems/1.8/gems/bundler-1.0.3/lib/bundler/runtime.rb:64)
>> Thin web server (v1.2.6 codename Crazy Delicious)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:51899, CTRL+C to stop

And here is the pages_controller.rb:

class PagesController < ApplicationController

  def home
    @title = "Home"
    if signed_in?
      @micropost = Micropost.new 
      @feed_items = current_user.feed.paginate(:page => params[:page])
    end
  end

  def contact
    @title = "Contact"
  end

  def about
    @title = "About"
  end

  def help
    @title = "Help"
  end
end


OK...dumbest question ever. I'm playing the newbie card....forgot the "heroku rake db:migrate". All's well now.

0

精彩评论

暂无评论...
验证码 换一张
取 消