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

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

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

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

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

Q&A

解決済

2回答

4280閲覧

railsサーバー起動時に発生するエラー、Add `gem 'listen'` to the development group of your Gemfile (LoadError)を解決したい

kingyo0802

総合スコア27

Ruby on Rails 5

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

Ruby

Rubyはプログラミング言語のひとつで、オープンソース、オブジェクト指向のプログラミング開発に対応しています。

0グッド

0クリップ

投稿2019/09/24 18:59

発生している問題とエラーメッセージ

railsのサーバー起動時に↓のエラーが出ているのですが、これを解決したいです。

/home/ec2-user/.rvm/gems/ruby-2.6.3/gems/bootsnap- 1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22: in `require': Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile (LoadError)

試したこと

エラー文を読み。gemfileのdeveropmentにlistenを加えてくれと、書かれていたので
gemfileを確認してみたところ、既にlistenのgemは加わっており、gemfile.lockにも反映されていました
年の為、bundle installを再度行ったのですが、上記のエラーは解決せず、一体何が原因なのか? 解決の糸口を
見つける事が出来なかった為質問させていただきました。

該当のソースコード

gemfile

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.6.3' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.3' gem 'bootstrap', '~> 4.3.1' gem 'jquery-rails' gem 'font-awesome-rails' gem 'omniauth' gem 'omniauth-facebook' gem 'omniauth-google-oauth2' gem 'dotenv-rails' gem 'bcrypt', '3.1.12' # Use sqlite3 as the database for Active Record gem 'rails-controller-testing' # Use Puma as the app server gem 'puma', '~> 3.11' # Use SCSS for stylesheets gem 'sass-rails', '~> 5.0' # Use Uglifier as compressor for JavaScript assets gem 'uglifier', '>= 1.3.0' # See https://github.com/rails/execjs#readme for more supported runtmes # gem 'mini_racer', platforms: :ruby # Use CoffeeScript for .coffee assets and views gem 'coffee-rails', '~> 4.2' # Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks gem 'turbolinks', '~> 5' # Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder gem 'jbuilder', '~> 2.5' gem 'will_paginate', '3.1.7' gem 'bootstrap-will_paginate', '1.0.0' # Use Redis adapter to run Action Cable in production # gem 'redis', '~> 4.0' # Use ActiveModel has_secure_password # gem 'bcrypt', '~> 3.1.7' # Use ActiveStorage variant # gem 'mini_magick', '~> 4.8' # Use Capistrano for deployment # gem 'capistrano-rails', group: :development # Reduces boot times through caching; required in config/boot.rb gem 'bootsnap', '>= 1.1.0', require: false gem 'carrierwave' gem 'mini_magick','4.7.0' group :development, :test do # Call 'byebug' anywhere in the code to stop execution and get a debugger console gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] gem 'sqlite3' end group :development do # Access an interactive console on exception pages or by calling 'console' anywhere in the code. gem 'web-console', '>= 3.3.0' gem 'listen' ←ここ # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring gem 'spring' gem 'spring-watcher-listen', '~> 2.0.0' gem 'faker' , '1.9.1' end group :test do # Adds support for Capybara system testing and selenium driver gem 'capybara', '>= 2.15' gem 'selenium-webdriver' # Easy installation and use of chromedriver to run system tests with Chrome gem 'chromedriver-helper' end group :production do gem 'pg', '0.20.0' end

gemfile.lock(一部省略)

GEM remote: https://rubygems.org/ specs: rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) actionview (5.2.3) activesupport (= 5.2.3) builder (~> 3.1) erubi (~> 1.4) i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) addressable (2.7.0) public_suffix (>= 2.0.2, < 5.0) archive-zip (0.12.0) io-like (~> 0.3.0) arel (9.0.0) autoprefixer-rails (9.6.1.1) execjs bcrypt (3.1.12) bindex (0.8.1) bootsnap (1.4.5) msgpack (~> 1.0) bootstrap (4.3.1) listen (3.1.5) ←ここ rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) ruby_dep (~> 1.2) loofah (2.2.3) crass (~> 1.0.2) nokogiri (>= 1.5.9) mail (2.7.1) mini_mime (>= 0.1.1) marcel (0.3.3) mimemagic (~> 0.3.2) method_source (0.9.2) mimemagic (0.3.3) mini_magick (4.7.0) mini_mime (1.0.2) mini_portile2 (2.4.0) minitest (5.12.0) msgpack (1.3.1) multi_json (1.13.1) multi_xml (0.6.0) multipart-post (2.1.1) nio4r (2.5.2) nokogiri (1.10.4) mini_portile2 (~> 2.4.0) oauth2 (1.4.1) faraday (>= 0.8, < 0.16.0) jwt (>= 1.0, < 3.0) multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) omniauth (1.9.0) hashie (>= 3.4.6, < 3.7.0) rack (>= 1.6.2, < 3) omniauth-facebook (5.0.0) omniauth-oauth2 (~> 1.2) omniauth-google-oauth2 (0.8.0) jwt (>= 2.0) omniauth (>= 1.1.1) omniauth-oauth2 (>= 1.6) omniauth-oauth2 (1.6.0) oauth2 (~> 1.1) omniauth (~> 1.9) pg (0.20.0) popper_js (1.14.5) public_suffix (4.0.1) puma (3.12.1) rack (2.0.7) rack-test (1.1.0) rack (>= 1.0, < 3) rails (5.2.3) actioncable (= 5.2.3) actionmailer (= 5.2.3) actionpack (= 5.2.3) actionview (= 5.2.3) activejob (= 5.2.3) activemodel (= 5.2.3) activerecord (= 5.2.3) activestorage (= 5.2.3) activesupport (= 5.2.3) bundler (>= 1.3.0) railties (= 5.2.3) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.4) actionpack (>= 5.0.1.x) actionview (>= 5.0.1.x) activesupport (>= 5.0.1.x) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) rails-html-sanitizer (1.2.0) loofah (~> 2.2, >= 2.2.2) railties (5.2.3) actionpack (= 5.2.3) activesupport (= 5.2.3) method_source rake (>= 0.8.7) thor (>= 0.19.0, < 2.0) rake (12.3.3) rb-fsevent (0.10.3) rb-inotify (0.10.0) ffi (~> 1.0) regexp_parser (1.6.0) ruby-vips (2.0.15) ffi (~> 1.9) ruby_dep (1.5.0) rubyzip (1.2.4) sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) sass-rails (5.1.0) railties (>= 5.2.0) sass (~> 3.1) sprockets (>= 2.8, < 4.0) sprockets-rails (>= 2.0, < 4.0) tilt (>= 1.1, < 3) sassc (2.2.1) ffi (~> 1.9) sassc-rails (2.1.2) railties (>= 4.0.0) sassc (>= 2.0) sprockets (> 3.0) sprockets-rails tilt selenium-webdriver (3.142.4) childprocess (>= 0.5, < 3.0) rubyzip (~> 1.2, >= 1.2.2) spring (2.1.0) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0)             ←ここ spring (>= 1.2, < 3.0) sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) sqlite3 (1.4.1) thor (0.20.3) thread_safe (0.3.6) tilt (2.0.10) turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) tzinfo (1.2.5) thread_safe (~> 0.1) uglifier (4.1.20) execjs (>= 0.3.0, < 3) web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) websocket-driver (0.7.1) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.4) will_paginate (3.1.7) xpath (3.2.0) nokogiri (~> 1.8) PLATFORMS ruby DEPENDENCIES bcrypt (= 3.1.12) bootsnap (>= 1.1.0) bootstrap (~> 4.3.1) bootstrap-will_paginate (= 1.0.0) byebug capybara (>= 2.15) carrierwave chromedriver-helper coffee-rails (~> 4.2) dotenv-rails faker (= 1.9.1) font-awesome-rails jbuilder (~> 2.5) jquery-rails listen                        ←ここ mini_magick (= 4.7.0) omniauth omniauth-facebook omniauth-google-oauth2 pg (= 0.20.0) puma (~> 3.11) rails (~> 5.2.3) rails-controller-testing sass-rails (~> 5.0) selenium-webdriver spring spring-watcher-listen (~> 2.0.0) sqlite3 turbolinks (~> 5) uglifier (>= 1.3.0) web-console (>= 3.3.0) will_paginate (= 3.1.7) RUBY VERSION ruby 2.6.3p62 BUNDLED WITH

補足情報(FW/ツールのバージョンなど)

rails 5.2.6. ruby2.6.3

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

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

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

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

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

guest

回答2

0

自己解決

一応、解決したので追記します。

listenのgemをdeveropmentから外し、共通のgemにしたらうまく行きました。

投稿2019/09/25 13:54

kingyo0802

総合スコア27

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

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

0

# gem 'redis', '~> 4.0' の部分を有効にしてみてください

投稿2019/09/25 01:06

退会済みユーザー

退会済みユーザー

総合スコア0

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

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

kingyo0802

2019/09/25 12:40

回答ありがとうございます! 有効にして、もう一度bundle installしてみたのですが状況は変わらずですね……
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問