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

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

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

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

Ruby on Rails

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

Q&A

0回答

888閲覧

railsでgemを導入したらサーバーが立たなくなりました

Ngayope

総合スコア0

Ruby

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

Ruby on Rails

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

0グッド

1クリップ

投稿2020/08/27 13:20

編集2020/08/28 03:56

前提・実現したいこと

Rails初心者です。

rails new

で作成したアプリに「eturem」というgemを導入したいと考えています。
Gemfileに記述し、$ bundle installとするまでは良かったのですが、rails sでサーバーを立ち上げる際に以下のエラーメッセージが発生しました。
eturemのインストール以前はサーバーが立てられたので、原因はインストール前後にあると考えましたが、どうすれば解決できるのかが分からず、困っています。
解決方法について、ご助言いただけないでしょうか。どうかよろしくお願いします。

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

% rails s bin/rails:7: warning: already initialized constant APP_PATH => 7: APP_PATH = File.expand_path('../config/application', __dir__) bin/rails:7: warning: previous definition of APP_PATH was here => 7: APP_PATH = File.expand_path('../config/application', __dir__)

該当のソースコード

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', '~> 6.0.3', '>= 6.0.3.2' 8# Use sqlite3 as the database for Active Record 9gem 'sqlite3', '~> 1.4' 10# Use Puma as the app server 11gem 'puma', '~> 4.1' 12# Use SCSS for stylesheets 13gem 'sass-rails', '>= 6' 14# Transpile app-like JavaScript. Read more: https://github.com/rails/webpacker 15gem 'webpacker', '~> 4.0' 16# Turbolinks makes navigating your web application faster. Read more: https://github.com/turbolinks/turbolinks 17gem 'turbolinks', '~> 5' 18# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 19gem 'jbuilder', '~> 2.7' 20# Use Redis adapter to run Action Cable in production 21# gem 'redis', '~> 4.0' 22# Use Active Model has_secure_password 23# gem 'bcrypt', '~> 3.1.7' 24gem 'eturem' 25# Use Active Storage variant 26# gem 'image_processing', '~> 1.2' 27 28# Reduces boot times through caching; required in config/boot.rb 29gem 'bootsnap', '>= 1.4.2', require: false 30 31group :development, :test do 32 # Call 'byebug' anywhere in the code to stop execution and get a debugger console 33 gem 'byebug', platforms: [:mri, :mingw, :x64_mingw] 34end 35 36group :development do 37 # Access an interactive console on exception pages or by calling 'console' anywhere in the code. 38 gem 'web-console', '>= 3.3.0' 39 gem 'listen', '~> 3.2' 40 # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring 41 gem 'spring' 42 gem 'spring-watcher-listen', '~> 2.0.0' 43end 44 45group :test do 46 # Adds support for Capybara system testing and selenium driver 47 gem 'capybara', '>= 2.15' 48 gem 'selenium-webdriver' 49 # Easy installation and use of web drivers to run system tests with browsers 50 gem 'webdrivers' 51end 52 53# Windows does not include zoneinfo files, so bundle the tzinfo-data gem 54gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] 55

試したこと

https://qiita.com/QUANON/items/636be47e4261962062e9
同様のエラーコードに対する対処が書かれたサイトを検索し、上記のサイトの対処法のうち、rake rails:update:binを実行し、以下の結果が返ってきましたが、結局何を治せば良いか分からずそれ以上のことは試せていません。

% rake rails:update:bin rake aborted! NoMethodError: undefined method `load_tasks' for nil:NilClass /Users/ngayope/Desktop/ruby_lesson/eturem_check/Rakefile:6:in `<main>' /Users/ngayope/Desktop/ruby_lesson/eturem_check/config/application.rb:7:in `<top (required)>' /Users/ngayope/Desktop/ruby_lesson/eturem_check/Rakefile:4:in `require_relative' /Users/ngayope/Desktop/ruby_lesson/eturem_check/Rakefile:4:in `<top (required)>' (See full trace by running task with --trace)

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

Rails 6.0.3.2
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]

初質問のため、必要な情報を載せ切れていないかもしれません。その際は教えていただければ情報を追加します。お手数おかけして申し訳ありませんが、何卒よろしくお願いします。

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

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

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

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

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

guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

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

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

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

ただいまの回答率
85.46%

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

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

質問する

関連した質問