質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Devise

Deviseとは、Ruby-on-Railsの認証機能を追加するプラグインです。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

Q&A

0回答

540閲覧

git push heroku masterを行うとNameError: uninitialized constant Deviseと出てくる

keisuke713

総合スコア25

Ruby on Rails 5

Ruby on Rails 5は、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Devise

Deviseとは、Ruby-on-Railsの認証機能を追加するプラグインです。

Heroku

HerokuはHeroku社が開発と運営を行っているPaaSの名称です。RubyやNode.js、Python、そしてJVMベース(Java、Scala、Clojureなど)の複数のプログラミング言語をサポートしている。

1グッド

0クリップ

投稿2019/10/22 01:43

*解決したいこと
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

以上、もし分かる方いらっしゃいましたら、ご回答よろしくお願いします。

退会済みユーザー👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだ回答がついていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問