前提・実現したいこと
Railsでカリキュラムに沿ってインスタのようなものを作っています。
1回1通り作り終えて、もう1度最初から作成しています。
トップページにメインロゴ(画像)を表示させるために、1回目と同じように書きましたが、
なぜかエラーが発生してしまいました。
発生している問題・エラーメッセージ
ログを確認して、ActionController::RoutingError (No route matches [GET] "/images/logo.png"):
このエラーが発生していることは認識できましたが、解決法が見つかりません。
Started GET "/images/logo.png" for ::1 at 2019-09-15 02:07:36 +0900 ActionController::RoutingError (No route matches [GET] "/images/logo.png"): actionpack (5.2.3) lib/action_dispatch/middleware/debug_exceptions.rb:65:in `call' web-console (3.7.0) lib/web_console/middleware.rb:135:in `call_app' web-console (3.7.0) lib/web_console/middleware.rb:30:in `block in call' web-console (3.7.0) lib/web_console/middleware.rb:20:in `catch' web-console (3.7.0) lib/web_console/middleware.rb:20:in `call' actionpack (5.2.3) lib/action_dispatch/middleware/show_exceptions.rb:33:in `call' railties (5.2.3) lib/rails/rack/logger.rb:38:in `call_app' railties (5.2.3) lib/rails/rack/logger.rb:26:in `block in call' activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `block in tagged' activesupport (5.2.3) lib/active_support/tagged_logging.rb:28:in `tagged' activesupport (5.2.3) lib/active_support/tagged_logging.rb:71:in `tagged' railties (5.2.3) lib/rails/rack/logger.rb:26:in `call' sprockets-rails (3.2.1) lib/sprockets/rails/quiet_assets.rb:13:in `call' actionpack (5.2.3) lib/action_dispatch/middleware/remote_ip.rb:81:in `call' actionpack (5.2.3) lib/action_dispatch/middleware/request_id.rb:27:in `call' rack (2.0.7) lib/rack/method_override.rb:22:in `call' rack (2.0.7) lib/rack/runtime.rb:22:in `call' activesupport (5.2.3) lib/active_support/cache/strategy/local_cache_middleware.rb:29:in `call' actionpack (5.2.3) lib/action_dispatch/middleware/executor.rb:14:in `call' actionpack (5.2.3) lib/action_dispatch/middleware/static.rb:127:in `call' rack (2.0.7) lib/rack/sendfile.rb:111:in `call' railties (5.2.3) lib/rails/engine.rb:524:in `call' puma (3.12.1) lib/puma/configuration.rb:227:in `call' puma (3.12.1) lib/puma/server.rb:660:in `handle_request' puma (3.12.1) lib/puma/server.rb:474:in `process_client' puma (3.12.1) lib/puma/server.rb:334:in `block in run' puma (3.12.1) lib/puma/thread_pool.rb:135:in `block in spawn_thread'
該当のソースコード
scss
1.navbar { 2 background-color: #fff; 3 border-bottom: 1px solid rgba(0, 0, 0, .0975); 4 height: 77px; 5 &__brand { 6 height: 35px; 7 width: 176px; 8 background-size: 114px; 9 } 10 &__mainLogo { 11 background-repeat: no-repeat; 12 background-image: image-url("logo.png"); 13 } 14 &-nav { 15 & > li { 16 margin-left: 20px; 17 &:first-child { 18 margin-left: 0; 19 } 20 .commonNavIcon { 21 height: 24px; 22 width: 24px; 23 background-size: 22px !important; 24 background-repeat: no-repeat; 25 } 26 .profile-icon { 27 background-image: image-url("parts3.png"); 28 } 29 } 30 } 31} 32
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 rails-ujs 14//= require activestorage 15//= require turbolinks 16//= require jquery3 17//= require popper 18//= require bootstrap-sprockets 19//= require_tree .
試したこと
前回うまくいった方のディレクトリと比較。
補足情報(FW/ツールのバージョンなど)
Rails5.2.3
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/09/15 16:44