前提・実現したいこと
Syntax Error in〜 を解決したい
発生している問題・エラーメッセージ
http://localhost:3000 Sass::SyntaxError in Posts#index Showing /Users/kojin/Dr_shinkyu/app/views/layouts/application.html.haml where line #7 raised: File to import not found or unreadable: posts. Load paths: /Users/kojin/Dr_shinkyu/app/assets/config /Users/kojin/Dr_shinkyu/app/assets/images /Users/kojin/Dr_shinkyu/app/assets/javascripts /Users/kojin/Dr_shinkyu/app/assets/stylesheets /Users/kojin/Dr_shinkyu/vendor/assets/javascripts /Users/kojin/Dr_shinkyu/vendor/assets/stylesheets /Users/kojin/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/jquery-rails-4.4.0/vendor/assets/javascripts /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/coffee-rails-4.2.2/lib/assets/javascripts /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actioncable-6.0.3.4/app/assets/javascripts /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/activestorage-6.0.3.4/app/assets/javascripts /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/actionview-6.0.3.4/lib/assets/compiled /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/turbolinks-source-5.2.0/lib/assets/javascripts /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/bourbon-7.0.0/core /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/font-awesome-sass-5.15.1/assets/stylesheets /Users/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/font-awesome-sass-5.15.1/assets/fonts Extracted source (around line #18): 16 17@import "posts"; 18@import "bourbon"; 19@import "font-awesome-sprockets"; 20@import "font-awesome";
該当のソースコード
applictaion.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, vendor/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. * *= require_tree . *= require_self */ @import "posts"; @import "bourbon"; @import "font-awesome-sprockets"; @import "font-awesome";
applictaion.html.haml !!! %html %head %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ %title DrShinkyu = csrf_meta_tags = stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' = javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %body = yield
試したこと(仮説)
下記のサイトを参考にしました。
リンク内容
補足
rails6にてActiontextを試行錯誤しながら色々調べたりして実装していました。
正直、このエラーになった原因が解らなくて困っています。
何かヒントでもと思い質問させて頂きました。
宜しくお願い致します。
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2020/11/05 22:05