前提・実現したいこと
ここに質問の内容を詳しく書いてください。
railsでfullcalendarを導入するタイミングで以下のエラーメッセージが発生しました。
発生している問題・エラーメッセージ
events:42 GET http://localhost:3000/fullcalendar/daygrid/main.css net::ERR_ABORTED 404 (Not Found) events:45 GET http://localhost:3000/fullcalendar/core/main.js net::ERR_ABORTED 404 (Not Found) events:43 GET http://localhost:3000/fullcalendar/timegrid/main.css net::ERR_ABORTED 404 (Not Found) events:44 GET http://localhost:3000/fullcalendar/list/main.css net::ERR_ABORTED 404 (Not Found) events:46 GET http://localhost:3000/fullcalendar/interaction/main.js net::ERR_ABORTED 404 (Not Found) events:47 GET http://localhost:3000/fullcalendar/daygrid/main.js net::ERR_ABORTED 404 (Not Found) events:49 GET http://localhost:3000/fullcalendar/list/main.js net::ERR_ABORTED 404 (Not Found) events:45 GET http://localhost:3000/fullcalendar/core/main.js net::ERR_ABORTED 404 (Not Found) events:48 GET http://localhost:3000/fullcalendar/timegrid/main.js net::ERR_ABORTED 404 (Not Found) events:46 GET http://localhost:3000/fullcalendar/interaction/main.js net::ERR_ABORTED 404 (Not Found) events:47 GET http://localhost:3000/fullcalendar/daygrid/main.js net::ERR_ABORTED 404 (Not Found) events:48 GET http://localhost:3000/fullcalendar/timegrid/main.js net::ERR_ABORTED 404 (Not Found) events:49 GET http://localhost:3000/fullcalendar/list/main.js net::ERR_ABORTED 404 (Not Found)
該当のソースコード
ruby
1app/views/events/index.html.haml 2 3!!! 4%html 5 %head 6 %meta{:content => "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}/ 7 %meta{:charset => "utf-8"}/ 8 %link{:href => "fullcalendar/core/main.css", :rel => "stylesheet"}/ 9 %link{:href => "fullcalendar/daygrid/main.css", :rel => "stylesheet"}/ 10 %link{:href => "fullcalendar/timegrid/main.css", :rel => "stylesheet"}/ 11 %link{:href => "fullcalendar/list/main.css", :rel => "stylesheet"}/ 12 %script{:src => "fullcalendar/core/main.js"} 13 %script{:src => "fullcalendar/interaction/main.js"} 14 %script{:src => "fullcalendar/daygrid/main.js"} 15 %script{:src => "fullcalendar/timegrid/main.js"} 16 %script{:src => "fullcalendar/list/main.js"} 17 :javascript 18 document.addEventListener('DOMContentLoaded', function() { 19 var calendarEl = document.getElementById('calendar'); 20 21 var calendar = new FullCalendar.Calendar(calendarEl, { 22 plugins: [ 'interaction', 'dayGrid', 'timeGrid', 'list' ], 23 header: { 24 left: 'prev,next today', 25 center: 'title', 26 right: 'dayGridMonth,timeGridWeek,timeGridDay,listMonth' 27 }, 28 defaultDate: '2020-02-12', 29 navLinks: true, // can click day/week names to navigate views 30 businessHours: true, // display business hours 31 editable: true, 32 events: [ 33 { 34 title: 'Business Lunch', 35 start: '2020-02-03T13:00:00', 36 constraint: 'businessHours' 37 }, 38 { 39 title: 'Meeting', 40 start: '2020-02-13T11:00:00', 41 constraint: 'availableForMeeting', // defined below 42 color: '#257e4a' 43 }, 44 { 45 title: 'Conference', 46 start: '2020-02-18', 47 end: '2020-02-20' 48 }, 49 { 50 title: 'Party', 51 start: '2020-02-29T20:00:00' 52 }, 53 54 // areas where "Meeting" must be dropped 55 { 56 groupId: 'availableForMeeting', 57 start: '2020-02-11T10:00:00', 58 end: '2020-02-11T16:00:00', 59 rendering: 'background' 60 }, 61 { 62 groupId: 'availableForMeeting', 63 start: '2020-02-13T10:00:00', 64 end: '2020-02-13T16:00:00', 65 rendering: 'background' 66 }, 67 68 // red areas where no events can be dropped 69 { 70 start: '2020-02-24', 71 end: '2020-02-28', 72 overlap: false, 73 rendering: 'background', 74 color: '#ff9f89' 75 }, 76 { 77 start: '2020-02-06', 78 end: '2020-02-08', 79 overlap: false, 80 rendering: 'background', 81 color: '#ff9f89' 82 } 83 ] 84 }); 85 86 calendar.render(); 87 }); 88 :css 89 body { 90 margin: 40px 10px; 91 padding: 0; 92 font-family: Arial, Helvetica Neue, Helvetica, sans-serif; 93 font-size: 14px; 94 } 95 96 #calendar { 97 max-width: 900px; 98 margin: 0 auto; 99 } 100 %body 101 102.header 103 = render 'shared/header' 104 105#calendar 106
試したこと
パスが違う可能性が高いと思ったので、DLしたfailの該当するページを直接フォルダ内に入れ込み呼び出したり、公式ページの内容を参考にpassを変えてみましたが、どうにも上手く読み込んでくれずに苦心しています。
正しいフォルダの配置場所、もしくはそれ以前の問題ということもあるかと思いますが、ご教示いただけましたら幸いです。
補足情報(FW/ツールのバージョンなど)
Rails 5.2.4.1
参考資料
公式ページ
https://fullcalendar.io/docs/initialize-globals
qiitaの記事
https://qiita.com/imp555sti/items/ee9809768f6dc9439ab5
回答に記載してしまいましたが…もしGem無しで実装するのであれば、どのパスにどのファイルを配置したのかが記載されていると回答される方も答えやすくなると思います!