Error when pushing to Heroku - StatementInvalid - Ruby on Rails

Posted by bgadoci on Stack Overflow See other posts from Stack Overflow or by bgadoci
Published on 2010-04-21T19:42:22Z Indexed on 2010/04/21 19:53 UTC
Read the original article Hit count: 438

I am trying to deploy my first rails app to Heroku and seem to be having a problem. After git push heroku master I get an error saying that relation "tags does not exist. I understand that without knowledge of my application it will be hard to help but I am wondering if someone can point me in the right direction. I have checked the schema.rb file and also been over all my migrations and there doesn't seem to be a problem there. The error message lead me to believe that I left something out of my routes.rb file but can't seem to find anything there either. Perhaps just some help deciphering this message.

Processing PostsController#index (for 99.7.50.140 at 2010-04-21 12:28:59) [GET]

ActiveRecord::StatementInvalid (PGError: ERROR:  relation "tags" 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 = '"tags"'::regclass
               AND a.attnum > 0 AND NOT a.attisdropped
             ORDER BY a.attnum
):
  app/controllers/posts_controller.rb:9:in `index'
  /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.0.1) lib/thin/connection.rb:80:in `pre_process'
  thin (1.0.1) lib/thin/connection.rb:78:in `catch'
  thin (1.0.1) lib/thin/connection.rb:78:in `pre_process'
  thin (1.0.1) lib/thin/connection.rb:57:in `process'
  thin (1.0.1) lib/thin/connection.rb:42:in `receive_data'
  eventmachine (0.12.6) lib/eventmachine.rb:240:in `run_machine'
  eventmachine (0.12.6) lib/eventmachine.rb:240:in `run'
  thin (1.0.1) lib/thin/backends/base.rb:57:in `start'
  thin (1.0.1) lib/thin/server.rb:150:in `start'
  thin (1.0.1) lib/thin/controllers/controller.rb:80:in `start'
  thin (1.0.1) lib/thin/runner.rb:173:in `send'
  thin (1.0.1) lib/thin/runner.rb:173:in `run_command'
  thin (1.0.1) lib/thin/runner.rb:139:in `run!'
  thin (1.0.1) bin/thin:6
  /usr/local/bin/thin:20:in `load'
  /usr/local/bin/thin:20

Also, here is my routes.rb file if that helps at all.

ActionController::Routing::Routes.draw do |map|

  map.resources :ugtags
  map.resources :wysihat_files
  map.resources :users
  map.resources :votes
  map.resources :votes, :belongs_to => :user
  map.resources :tags, :belongs_to => :user
  map.resources :ugtags, :belongs_to => :user
  map.resources :posts, :collection => {:auto_complete_for_tag_tag_name => :get }
  map.resources :posts, :sessions
  map.resources :posts, :has_many => :comments
  map.resources :posts, :has_many => :tags
  map.resources :posts, :has_many => :ugtags
  map.resources :posts, :has_many => :votes
  map.resources :posts, :belongs_to => :user
  map.resources :tags, :collection => {:auto_complete_for_tag_tag_name => :get }
  map.resources :ugtags, :collection => {:auto_complete_for_ugtag_ugctag_name => :get }

  map.login 'login', :controller => 'sessions', :action => 'new'
  map.logout 'logout', :controller => 'sessions', :action => 'destroy'
  map.root :controller => "posts"

  map.connect ':controller/:action/:id'
  map.connect ':controller/:action/:id.:format'
end

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about ruby