2

hi i am currently doing a blog in which will be used later and i have added devise into it , having finished in my local machine i uploaded it in the heroku and then i got a very fantastic error that i cant seem to fix, i also tried to change it in the production and doing this into the codes

this is for the config/environment/production

config.consider_all_requests_local = true #false

to see what kind of error it give and this is what i got

ActiveRecord::StatementInvalid in Devise::RegistrationsController#new

PG::UndefinedTable: ERROR: relation "users" does not exist LINE 5: WHERE a.attrelid = '"users"'::regclass ^ : SELECT a.attname, format_type(a.atttypid, a.atttypmod), pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"users"'::regclass AND a.attnum > 0 AND NOT a.attisdropped ORDER BY a.attnum

Extracted source (around line #592):
590    def exec_no_cache(sql, name, binds)
591     log(sql, name, binds) { @connection.async_exec(sql, []) }
592     end
593    
594
595

any help will do , as i have tried and did the

heroku run rake db:migrate
heroku run bundle exec rake db:migrate

and i dont know what to do next

this is my gems

 gem 'rails', '4.2.0'
 gem 'sass-rails', '~> 5.0'
 gem 'uglifier', '>= 1.3.0'
 gem 'coffee-rails', '~> 4.1.0'
 gem 'jquery-rails'
 gem 'turbolinks'
 gem 'jbuilder', '~> 2.0'
 gem 'sdoc', '~> 0.4.0', group: :doc
 gem 'devise'
 gem 'bootstrap-sass', '~> 3.2.0'
 gem 'autoprefixer-rails'
 gem "paperclip", "~> 4.2"
 gem 'ckeditor'

 group :production, :staging do
   gem "pg"
 end

 group :development, :test do
   gem 'byebug'
   gem 'sqlite3'
   gem 'web-console', '~> 2.0'
   gem 'spring'
 end

any help would really be appreciated and thanks!

user1868185
  • 899
  • 3
  • 9
  • 24

1 Answers1

1

i found out the answer here: PG undefinedtable error relation users does not exist

the problem was i needed to run this code

 heroku run rake db:reset 

and that did help me acces the database and now it is working fine

Community
  • 1
  • 1
user1868185
  • 899
  • 3
  • 9
  • 24