前提
ユーザー登録を必要とするSNS的なアプリを開発中です。
いよいよα版を公開!と思ったら最後の最後につまづいています・・・
https://life-stamp-rally.herokuapp.com/users
Heroku上にアプリケーションを作成し、ブラウザにトップページを表示するところまでは出来ています。
しかしログインページや新規会員登録に遷移すると下記エラーが発生。
HeidiSQLを使用してデータベースに接続をしてみると、
本来あるはずのUsersテーブルがありませんでした!!
※HeidiSQL(herokuにデプロイしたアプリのデータベース)
Herokuのバージョンは18、
Rubyのバージョンは2.5.1、
railsのバージョンは5.2.2.1、
DBは開発環境でMySQL(phpmyadmin)を使っています。
アドオンは普通に問題無く出来ている様に見えます・・・
ec2-user:~/environment/ver0.3 (master) $ heroku addons:info cleardb === cleardb-crystalline-67196 Attachments: life-stamp-rally::CLEARDB_DATABASE Installed at: Tue Mar 26 2019 02:24:55 GMT+0000 (Coordinated Universal Time) Owning app: life-stamp-rally Plan: cleardb:ignite Price: free State: created
以下schema.rb
ActiveRecord::Schema.define(version: 2019_03_19_064642) do create_table "active_storage_attachments", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "name", null: false t.string "record_type", null: false t.bigint "record_id", null: false t.bigint "blob_id", null: false t.datetime "created_at", null: false t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id" t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true end create_table "active_storage_blobs", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "key", null: false t.string "filename", null: false t.string "content_type" t.text "metadata" t.bigint "byte_size", null: false t.string "checksum", null: false t.datetime "created_at", null: false t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true end create_table "countries", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "country" t.string "capital" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "continent" t.float "latitude", limit: 53 t.float "longitude", limit: 53 end create_table "remove_latitude_from_countries", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.integer "latitude" t.integer "longitude" t.datetime "created_at", null: false t.datetime "updated_at", null: false end create_table "stamps", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.integer "user_id" t.text "title" t.text "description" t.datetime "shooted_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.integer "country_id" end create_table "users", options: "ENGINE=InnoDB DEFAULT CHARSET=utf8", force: :cascade do |t| t.string "email", default: "", null: false t.string "encrypted_password", default: "", null: false t.string "reset_password_token" t.datetime "reset_password_sent_at" t.datetime "remember_created_at" t.datetime "created_at", null: false t.datetime "updated_at", null: false t.string "family_name" t.string "first_name" t.string "family_name_kana" t.string "first_name_kana" t.index ["email"], name: "index_users_on_email", unique: true t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true end add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id" end
以下database.yml
default: &default adapter: mysql2 encoding: utf8 pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> username: root password: socket: /var/lib/mysql/mysql.sock development: <<: *default database: ver0_2_development test: <<: *default database: ver0_2_test production: <<: *default database: ver0_2_production username: ver0_2 password: <%= ENV['VER0_2_DATABASE_PASSWORD'] %>
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.5.1' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.2', '>= 5.2.2.1' 8# Use mysql as the database for Active Record 9gem 'mysql2', '0.5.2' 10# Use Puma as the app server 11gem 'puma', '~> 3.11' 12# Use SCSS for stylesheets 13gem 'sass-rails', '~> 5.0.7' 14# Use Uglifier as compressor for JavaScript assets 15gem 'uglifier', '>= 1.3.0' 16# See https://github.com/rails/execjs#readme for more supported runtimes 17# gem 'mini_racer', platforms: :ruby 18 19# Use CoffeeScript for .coffee assets and views 20gem 'coffee-rails', '~> 4.2' 21# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 22gem 'turbolinks', '~> 5' 23# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 24gem 'jbuilder', '~> 2.5' 25# Use Redis adapter to run Action Cable in production 26# gem 'redis', '~> 4.0' 27# Use ActiveModel has_secure_password 28# gem 'bcrypt', '~> 3.1.7' 29 30# Use ActiveStorage variant 31# gem 'mini_magick', '~> 4.8' 32 33# Use Capistrano for deployment 34# gem 'capistrano-rails', group: :development 35 36# Reduces boot times through caching; required in config/boot.rb 37gem 'bootsnap', '>= 1.1.0', require: false 38 39group :development, :test do 40 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 41 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 42end 43 44group :development do 45 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 46 gem 'web-console', '>= 3.3.0' 47 gem 'listen', '>= 3.0.5', '< 3.2' 48 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 49 gem 'spring' 50 gem 'spring-watcher-listen', '~> 2.0.0' 51end 52 53group :test do 54 # Adds support for Capybara system testing and selenium driver 55 gem 'capybara', '>= 2.15' 56 gem 'selenium-webdriver' 57 # Easy installation and use of chromedriver to run system tests with Chrome 58 gem 'chromedriver-helper' 59end 60 61# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 62gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 63 64# アマゾンS3を追加 65gem 'aws-sdk-s3', require: false 66 67# 基本項目 68gem 'pry-rails' 69gem 'compass-rails', '3.1.0' 70gem 'sprockets', '3.7.2' 71gem 'hirb' 72gem 'hirb-unicode' 73 74# jQuery 75gem "jquery-rails" 76 77# ログイン 78gem 'devise' 79 80group :production do 81 gem 'rails_12factor' 82end
どなたかアドバイスを頂けると幸いです・・・
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。