*解決したいこと
git push heroku masterを行うとNameError: uninitialized constant Deviseと出てくるのを解決したいです。
*前提
現在railsでwebアプリを開発していてherokuにデプロイをしようとしている段階です。
*出てくるエラー
git push heroku masterとコマンドを叩くと以下のようなエラーが出ます。
remote: Running: rake assets:precompile remote: rake aborted! remote: NameError: uninitialized constant Devise
*試したこと
元々deviseは入れていたのですが使わない方針に変えたのでgemfileから消したのですが、エラーは解決しませんでした。
Gemfile
1source 'https://rubygems.org' 2git_source(:github) { |repo| "https://github.com/#{repo}.git" } 3 4ruby '2.6.3' 5 6# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 7gem 'rails', '~> 5.2.3' 8gem 'will_paginate', '3.1.7' 9gem 'carrierwave' 10gem 'rmagick' 11gem 'mini_magick' 12gem 'bootstrap-will_paginate', '1.0.0' 13gem 'bootstrap-sass', '3.3.7' 14# Use sqlite3 as the database for Active Record 15# gem 'sqlite3' 16# Use Puma as the app server 17gem 'puma', '~> 3.11' 18# Use SCSS for stylesheets 19gem 'sass-rails', '~> 5.0' 20# Use Uglifier as compressor for JavaScript assets 21gem 'uglifier', '>= 1.3.0' 22# See https://github.com/rails/execjs#readme for more supported runtimes 23# gem 'mini_racer', platforms: :ruby 24 25# Use CoffeeScript for .coffee assets and views 26gem 'coffee-rails', '~> 4.2' 27# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 28gem 'turbolinks', '~> 5' 29# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 30gem 'jbuilder', '~> 2.5' 31# Use Redis adapter to run Action Cable in production 32# gem 'redis', '~> 4.0' 33# Use ActiveModel has_secure_password 34# gem 'bcrypt', '~> 3.1.7' 35 36# Use ActiveStorage variant 37# gem 'mini_magick', '~> 4.8' 38 39# Use Capistrano for deployment 40# gem 'capistrano-rails', group: :development 41 42# Reduces boot times through caching; required in config/boot.rb 43gem 'bootsnap', '>= 1.1.0', require: false 44 45group :production do 46 gem 'pg', '0.20.0' 47end 48 49group :development, :test do 50 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 51 gem 'sqlite3', '1.3.13' 52 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 53 gem 'rspec-rails', '~>3.6.0' 54 gem 'factory_bot_rails', '~>4.10.0' 55 gem 'database_cleaner' 56 gem 'pry-rails' 57 gem 'pry-byebug' 58 gem 'pry-doc' 59end 60 61group :development do 62 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 63 gem 'web-console', '>= 3.3.0' 64 gem 'listen', '>= 3.0.5', '< 3.2' 65 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 66 gem 'spring' 67 gem 'spring-watcher-listen', '~> 2.0.0' 68 gem 'spring-commands-rspec' 69end 70 71group :test do 72 # Adds support for Capybara system testing and selenium driver 73 gem 'capybara', '>= 2.15' 74 gem 'selenium-webdriver' 75 # Easy installation and use of chromedriver to run system tests with Chrome 76 gem 'chromedriver-helper' 77end 78 79# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 80gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 81 82gem 'coffee-script-source', '1.8.0' 83gem 'bcrypt', '3.1.12' 84gem 'rails-controller-testing' 85gem 'slim-rails' 86gem 'html2slim'
bundle info deviseとコマンドを叩くと以下のような表示が出ることも確認済みです。
$ bundle info devise The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby but the dependency is only for x86-mingw32, x86-mswin32, x64-mingw32, java. To add those platforms to the bundle, run `bundle lock --add-platform x86-mingw32 x86-mswin32 x64-mingw32 java`. Could not find gem 'devise'.
*環境
rails 5.2
以上、もし分かる方いらっしゃいましたら、ご回答よろしくお願いします。
あなたの回答
tips
プレビュー