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

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

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

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

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

Q&A

解決済

1回答

452閲覧

rails sができなくなった。

ikdnaht

総合スコア13

Ruby on Rails 5

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

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

0グッド

1クリップ

投稿2020/01/23 12:29

編集2020/01/23 13:44

前提・実現したいこと

AWSのec2インスタンスにて本番環境にデプロイしている最中に、rails sができなくなりました。
エラー文から調べていったところbootstrap等、gemが原因の可能性が高いのではないかと考えているのですが、問題の原因と解決策をご教授いただけると幸いです。

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

/Users/naohito/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- image_processing/mini_magick (LoadError)

該当のソースコード

ターミナル

naohito@IkedanoMacBook-Pro match_hack % rails s => Booting Puma => Rails 5.2.4.1 application starting in development => Run `rails server -h` for more startup options Exiting Traceback (most recent call last): 168: from bin/rails:3:in `<main>' 167: from bin/rails:3:in `load' 166: from /Users/naohito/Desktop/match_hack/bin/spring:15:in `<top (required)>' 165: from /Users/naohito/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' 164: from /Users/naohito/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/core_ext/kernel_require.rb:59:in `require' ~省略~ /Users/naohito/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:89:in `register' 1: from /Users/naohito/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi' /Users/naohito/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require': cannot load such file -- image_processing/mini_magick (LoadError)

Gemfile

source 'https://rubygems.org' git_source(:github) { |repo| "https://github.com/#{repo}.git" } ruby '2.5.1' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '~> 5.2.3' # Use mysql as the database for Active Record gem 'mysql2', '>= 0.4.4', '< 0.6.0' # 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 runtimes # 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' # 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.2', require: false 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 'rspec-rails' gem 'factory_bot_rails' 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', '>= 3.0.5', '< 3.2' # 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' 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 'unicorn', '5.4.1' end # Windows does not include zoneinfo files, so bundle the tzinfo-data gem gem 'tzinfo-data', platforms: [:mingw, :mswin, :x64_mingw, :jruby] gem 'pry-rails' gem "haml-rails", ">= 1.0", '<= 2.0.1' gem 'carrierwave' gem 'mini_magick' gem 'bootstrap-sass' gem 'font-awesome-sass' gem 'webpacker' # ログイン機能 gem 'devise' # 日本語化 gem 'rails-i18n', '~> 5.1' gem 'devise-i18n' # Bootstrap # gem 'bootstrap', '~> 4.3.1' gem 'jquery-rails' gem 'devise-bootstrap-views', '~> 1.0' # gem 'popper_js', '~> 1.14.5'

app/assets/javascript/application.js

js

1// This is a manifest file that'll be compiled into application.js, which will include all the files 2// listed below. 3// 4// Any JavaScript/Coffee file within this directory, lib/assets/javascripts, or any plugin's 5// vendor/assets/javascripts directory can be referenced here using a relative path. 6// 7// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the 8// compiled file. JavaScript code in this file should be added after the last require_* statement. 9// 10// Read Sprockets README (https://github.com/rails/sprockets#sprockets-directives) for details 11// about supported directives. 12// 13//= require jquery3 14//= require popper 15//= require bootstrap-sprockets 16//= require rails-ujs 17//= require activestorage 18// = require_tree . 19

app/assets/stylesheets/application.scss

/* * This is a manifest file that'll be compiled into application.css, which will include all the files * listed below. * * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's * vendor/assets/stylesheets directory can be referenced here using a relative path. * * You're free to add application-wide styles to this file and they'll appear at the bottom of the * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS * files in this directory. Styles in this file should be added after the last require_* statement. * It is generally better to create a new file per style scope. * */ @import "./reset"; @import "bootstrap-sprockets"; @import "bootstrap"; @import "index"; @import "show"; @import "new"; @import "matching"; @import "messages"; @import "notifications"; @import "font-awesome-sprockets"; @import "./font-awesome";

試したこと

https://github.com/Shopify/bootsnap/issues/73

こちらのissueを参考に、bootsnap-load-path-cache と bootsnap-compile-cache を削除してみたのですが、改善がみられませんでした。

lsof -i4TCP:3000とps PIDコマンドにてport:3000番のプロセスがrails sによってlistenされているか確認してみたのですが、以下のような状態で起動していない状態かと思われます。

ps: illegal option -- P usage: ps [-AaCcEefhjlMmrSTvwXx] [-O fmt | -o fmt] [-G gid[,gid...]] [-u] [-p pid[,pid...]] [-t tty[,tty...]] [-U user[,user...]] ps [-L]

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

rails 5.2.4.1
ruby 2.5.1

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

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

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

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

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

m.ts10806

2020/01/23 12:37

Ruby on Rails をタグに追加しておいてください。 「Bootstrap」だけだと分かる人がそんなに多くないと思います。(私は「Bootstrap」で来ましたがそもそもRuby分からないので)
ikdnaht

2020/01/23 13:44

失礼いたしました。ただ今追加しました!
guest

回答1

0

自己解決

いろいろな手を打ち、結果的に自己解決に至りました。
主な原因と思われるのは、bundle updateによりrbenvのバージョンが上がり、諸々の齟齬が出てしまっていた事が考えられます。

投稿2020/01/26 13:00

ikdnaht

総合スコア13

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問