นี่คือสถานที่ที่ยอดเยี่ยม ฉันหวังว่าจะมีความสามารถเพียงพอที่จะช่วยแก้ไขปัญหาได้ในเร็วๆ นี้
ได้โปรดมีคนช่วยด้วย!!!
ฉันได้ดู YouTube หลายชั่วโมงและอ่านทุกโพสต์เกี่ยวกับการรวบรวมไปป์ไลน์สินทรัพย์ล่วงหน้าบนเว็บ
ไม่ว่าด้วยเหตุผลใดก็ตามฉันจึงตัดสินใจใช้ Rails 5.1.2 และไม่รู้ว่านั่นเป็นปัญหาหรือไม่
glyphicons ไม่แสดงผลบน Heroku หรือใช้งาน
rails s -e production
บน Ubuntu ท้องถิ่นของฉัน
ฉันพิมพ์
rake assets:precompile RAILS_ENV=production
และได้รับ
I, [2018-01-01T16:05:07.261287 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf
I, [2018-01-01T16:05:07.261968 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/glyphicons-halflings-regular-e395044093757d82afcb138957d06a1ea9361bdcf0b442d06a18a8051af57456.ttf.gz
I, [2018-01-01T16:05:07.263049 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/glyphicons-halflings-regular-fe185d11a49676890d47bb783312a0cda5a44c4039214094e7957b4c040ef11c.woff
I, [2018-01-01T16:05:07.264510 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/glyphicons-halflings-regular-fe185d11a49676890d47bb783312a0cda5a44c4039214094e7957b4c040ef11c.woff2
I, [2018-01-01T16:05:07.289833 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/application-c29c47294834d3d47956f910a3182df4a7db7d5864e82c6f758027f30669bafb.js
I, [2018-01-01T16:05:07.290028 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/application-c29c47294834d3d47956f910a3182df4a7db7d5864e82c6f758027f30669bafb.js.gz
I, [2018-01-01T16:05:14.175848 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/application-b896db4d9b9e69049347e71a1825dcdc1a4eed9147196fdd761afe6f12b556d4.css
I, [2018-01-01T16:05:14.176068 #4745] INFO -- : Writing /home/dracos/rails/video-store/public/assets/application-b896db4d9b9e69049347e71a1825dcdc1a4eed9147196fdd761afe6f12b556d4.css.gz
แต่ใน log/production.log ฉันได้รับ
FATAL -- : [849248f2-cd3c-4912-a10d-4f63bd5857ae] ActionController::RoutingError (ไม่มีเส้นทางที่ตรงกับ [GET] /assets/glyphicons-halflings-regular.ttf):
FATAL -- : [dfae9054-ad8a-4553-85a3-c55d55b1946c] ActionController::RoutingError (ไม่มีเส้นทางที่ตรงกับ [GET] /assets/glyphicons-halflings-regular.woff):
ฯลฯ...
ฉันไม่เข้าใจ?!? ฉันจะไม่แสร้งทำเป็นเข้าใจสิ่งที่เกิดขึ้นทั้งหมดภายใต้ฝากระโปรงของท่อส่งสินทรัพย์และต้องการตอนนี้ที่จะไม่ใช่มือใหม่ แต่นี่!?!? ทำไม ใครสามารถแจ้งให้เราทราบ?
/app/assets/stylesheets/bootstrap.css ของฉันได้รับการแก้ไขเพื่อแสดง
@font-face {
font-family: 'Glyphicons Halflings';
src: url('../assets/glyphicons-halflings-regular.eot');
src: url('../assets/glyphicons-halflings-regular.eot?#iefix') format('embedded-opentype'),
url('../assets/glyphicons-halflings-regular.woff2') format('woff2'),
url('../assets/glyphicons-halflings-regular.woff') format('woff'),
url('../assets/glyphicons-halflings-regular.ttf') format('truetype'),
url('../assets/glyphicons-halflings-regular.svg#glyphicons_halflingsregular') format('svg');
}
และที่น่าสนใจก็คือส่วน /assets/
จะถูกเพิ่มเข้าไป แม้ว่าฉันจะปล่อยส่วนนั้นไว้นอกเส้นทาง URL ในไฟล์ด้านบนทั้งหมดก็ตาม ฉันได้ลองทุกอย่างแล้ว ใครสามารถช่วยได้บ้าง? ความช่วยเหลือใด ๆ ที่จะได้รับการชื่นชมมาก
ไชโย