0
我正在使用devise進行身份驗證。它在本地運行良好,但在heroku上嘗試登錄或註冊時出現錯誤。登錄不適用於我的rails應用程序的heroku
這裏是heroku日誌。我不得不削減了很多,因爲顯然它後面的代碼太多了。如果需要,我可以張貼更多。提前致謝!
2015-01-21T08:46:21.690491+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/postgresql_adapter.rb:733:in `column_definitions'
2015-01-21T08:46:21.690522+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
2015-01-21T08:46:21.690534+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
2015-01-21T08:46:21.690548+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-
2015-01-21T08:46:21.690505+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/devise-3.4.1/app/controllers/devise/registrations_controller.rb:7:in `new'
2015-01-21T08:46:21.690519+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:234:in `block in halting'
2015-01-21T08:46:21.690531+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:169:in `block in halting'
2015-01-21T08:46:21.690541+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/callbacks.rb:151:in `block in halting_and_conditional'
2015-01-21T08:46:21.690556+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/notifications/instrumenter.rb:20:in `instrument'
2015-01-21T08:46:21.690569+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_controller/metal.rb:236:in `block in action'
2015-01-21T08:46:21.690579+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/journey/router.rb:30:in `serve'
2015-01-21T08:46:21.690594+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/params_parser.rb:27:in `call'
2015-01-21T08:46:21.690603+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activerecord-4.2.0/lib/active_record/connection_adapters/abstract/connection_pool.rb:647:in `call'
2015-01-21T08:46:21.690635+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/activesupport-4.2.0/lib/active_support/tagged_logging.rb:68:in `block in tagged'
2015-01-21T08:46:21.690648+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/actionpack-4.2.0/lib/action_dispatch/middleware/static.rb:113:in `call'
2015-01-21T08:46:21.688700+00:00 app[web.1]: PG::UndefinedTable: ERROR: relation "users" does not exist
2015-01-21T08:46:21.688715+00:00 app[web.1]: AND a.attnum > 0 AND NOT a.attisdropped
2015-01-21T08:46:21.690463+00:00 app[web.1]: : SELECT a.attname, format_type(a.atttypid, a.atttypmod),
2015-01-21T08:46:21.690649+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/sendfile.rb:113:in `call'
2015-01-21T08:46:21.690652+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/railties-4.2.0/lib/rails/application.rb:164:in `call'
2015-01-21T08:46:21.690656+00:00 app[web.1]: vendor/bundle/ruby/2.2.0/gems/rack-1.6.0/lib/rack/handler/webrick.rb:89:in `service'
2015-01-21T08:46:21.921094+00:00 heroku[router]: at=info method=GET path="/favicon.ico" host=murmuring-coast-6346.herokuapp.com request_id=4e931974-f7bf-429d-8659-98f3c016fd8d fwd="67.164.93.44" dyno=web.1 connect=1ms service=4ms status=304 bytes=133
2015-01-21T08:46:21.695443+00:00 heroku[router]: at=info method=GET path="https://stackoverflow.com/users/sign_up" host=murmuring-coast-6346.herokuapp.com request_id=a148b692-c0a6-4998-8710-3a919b0c1025 fwd="67.164.93.44" dyno=web.1 connect=2ms service=12ms status=500 bytes=1754
的Gemfile
source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.0'
# Use sqlite3 as the database for Active Record
group :development, :test do
gem 'sqlite3'
end
gem 'devise'
gem 'cancan'
gem 'pg'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
gem 'uglifier', '>= 1.3.0'
# Use CoffeeScript for .coffee assets and views
gem 'coffee-rails', '~> 4.1.0'
# See https://github.com/sstephenson/execjs#readme for more supported runtimes
# gem 'therubyracer', platforms: :ruby
# Use jquery as the JavaScript library
gem 'jquery-rails'
# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks
gem 'jquery-turbolinks'
gem 'turbolinks'
# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder
gem 'jbuilder', '~> 2.0'
# bundle exec rake doc:rails generates the API under doc/api.
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'rails_12factor', group: :production
# Use ActiveModel has_secure_password
# gem 'bcrypt', '~> 3.1.7'
# Use Unicorn as the app server
# gem 'unicorn'
# Use Capistrano for deployment
# gem 'capistrano-rails', group: :development
gem 'paperclip'
group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug'
# Access an IRB console on exception pages or by using <%= console %> in views
gem 'web-console', '~> 2.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
ruby '2.2.0'
end
gem 'mocha', group: :test
你是否在heroku環境上運行遷移('heroku run bundle exec rake db:migrate')? – 2015-01-21 08:55:25
嘗試'rake db:migrate'好像你的表丟失了 – shivam 2015-01-21 08:55:47
好像你沒有用戶表在heroku上。因此,根據上述評論,您需要執行'rake db:migrate',然後您需要嘗試一下。 – 2015-01-21 09:19:01