STUDY MEMO

学習のメモ書き

エラー関連:Ruby on Rails

<Ruby on Rails エラー編> production環境でのrails sでActionController::RoutingErrorのエラーが発生

$ bundle exec rails s -e production プロダクション環境でサーバーを立ち上げたところ、scssが反映されていなかった。 原因を調べるためにproduction.logを見たところ、以下のようなログになっていた。 I, [2021-06-08T22:49:53.332919 #8860] INFO -- : […

<Ruby on Rails エラー編> ActionView::Template::Error (Webpacker can't find application.css ~ )

エラー エラー webpackerを使ってscssを管理しようとしたとき、以下のエラーが発生。 I, [2021-06-08T10:28:14.737101 #30893] INFO -- : [c266ae5e-e551-43a4-81bb-15fdfa2c28cf] Started GET "/" for 127.0.0.1 at 2021-06-08 10:28:14 +0900 I, [2021-06-…

<Ruby on Rails エラー編> herokuでデプロイするときに発生したエラー2

1回目 2回目 参考文献 1回目 -----> Building on the Heroku-20 stack -----> Using buildpack: heroku/ruby -----> Ruby app detected -----> Installing bundler 2.2.16 -----> Removing BUNDLED WITH version in the Gemfile.lock -----> Compiling Ruby/…

<Ruby on Rails エラー編> herokuでデプロイするときに発生したエラー

1回目 2回目 3回目 1回目 -----> Building on the Heroku-20 stack -----> Determining which buildpack to use for this app ! Warning: Multiple default buildpacks reported the ability to handle this app. The first buildpack in the list below wil…

<Ruby on Rails エラー編> PG::DuplicateTable: ERROR: relation "tweets" already exists

発生したエラー 対処法 参考文献 発生したエラー rails db:migrateを実行すると以下のエラーが発生した。 rails aborted! StandardError: An error has occurred, this and all later migrations canceled: PG::DuplicateTable: ERROR: relation "tweets" al…

<Ruby on Rails エラー編> mimemagicのbundle installエラーについて

エラーについて 対処法 参考文献 エラーについて mimemagicがbundle installできなくなった。 2021年3月下旬、twitterなどで大騒ぎになった。 大元が誤ったライセンスのもと配布していたようで、MITで配布していたが、実際はmimemagicの中のファイルがshared…

<Ruby on Rails エラー編> rails consoleが起動できない

発生したエラー 対処 参考文献 発生したエラー rails consoleを実行すると、以下のエラーが発生した。 Traceback (most recent call last): 17: from bin/rails:2:in `<main>' 16: from bin/rails:2:in `load' 15: from /Users/user_name/workspace/runteq/PF/kino</main>…

<Ruby on Rails エラー編> PostgreSQLに接続できなかった時の対処法

エラー詳細 やったこと 参考文献 エラー詳細 create db:createを実行しようとするとエラーが出た。 could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix domain socket "/tmp/.s.PGSQ…

<Ruby on Rails エラー編> rails -vをすると大量にignoring nokogiriが吐き出された

発生したエラー railsをnewした後bundle installし、ふとrails -vを押してみたら大量のignoring nokogiri ~というエラーが出た $ rails -v Ignoring nokogiri-1.10.9 because its extensions are not built. Try: gem pristine nokogiri --version 1.10.9 ..…

<Ruby on Rails エラー編> yarn install時のwarning ../../../package.json: No license field

発生したエラー > yarn install yarn install v1.22.10 warning ../../../package.json: No license field 指定のpackage.jsonにlicenseがない、ということでwarningが発生。 問題はないと思うが気持ち悪いので修正したいと思い、以下の対処方法を実施。 対…

<Ruby on Rails エラー編> bundle installで、Gem::Ext::BuildError: ERROR: Failed to build gem native extension.が発生

発生したエラー > bundle Warning: the running version of Bundler (2.0.2) is older than the version that created the lockfile (2.1.2). We suggest you upgrade to the latest version of Bundler by running `gem install bundler`. The dependency t…

<Ruby on Rails エラー編> Rack app ("GET /packs/js/application-f826770d917d8a37c1d8.js" - (::1))

rails sで以下のエラーが発生。 2021-03-07 02:36:40 +0900 Rack app ("GET /packs/js/application-f826770d917d8a37c1d8.js" - (::1)): #<Net::ReadTimeout: Net::ReadTimeout> 2021-03-07 02:36:40 +0900 Rack app ("GET /packs/js/application-f826770d917d8a37c1d8.js" - (::1)): #<Net::ReadTimeout: Net::ReadTimeout> 2021-03-0…</net::readtimeout:></net::readtimeout:>

<Ruby on Rails エラー編> Webpacker::Manifest::MissingEntryError

rails6でrails sをしたところ、以下のエラーが発生した。 Webpacker::Manifest::MissingEntryError Tasks#index # エラー発生場所 application.html.slim = javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' Webpacker can't find app…

<Ruby on Rails エラー編> ActiveRecord::RecordInvalid: Validation failed: Email has already been takenエラー

発生したエラー rails db:seedでFactoryBotのデータを作成しようとしたところ、 rails aborted! ActiveRecord::RecordInvalid: Validation failed: Email has already been taken ... といったエラーが出た。 考えたこと Raised by ActiveRecord::Base#save!…

<Ruby on Rails エラー編> bundle installが失敗した時の対処 〜libv8, mysql2, therubyracer〜

前提 libv8エラー 対処法 参考文献 mysql2エラー 対処法 参考文献 therubyracerエラー 対処法 参考文献 最終的な.bundle/configの中身 前提 ・Mac Retina ・MySQL Ver 14.14 Distrib 5.7.32 ・Redis 3.2.9 ・Node.js 12.14.0 ・Yarn 1.22.10 # Gemfile sourc…