質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

Q&A

解決済

1回答

2368閲覧

Rails : bootstrapの導入でSyntaxエラーが出る

takumikai

総合スコア16

Ruby on Rails

Ruby on Railsは、オープンソースのWebアプリケーションフレームワークです。「同じことを繰り返さない」というRailsの基本理念のもと、他のフレームワークより少ないコードで簡単に開発できるよう設計されています。

Bootstrap

BootstrapはウェブサイトデザインやUIのWebアプリケーションを素早く 作成する可能なCSSフレームワークです。 Twitter風のデザインを作成することができます。

1グッド

1クリップ

投稿2019/09/11 00:51

□ 何かの書き方が問題だとは思うのですが。
https://qiita.com/NaokiIshimura/items/c8db09daefff5c11dadf
この記事に従って、進めました。以前は行けたのですが、Railsのverを6.0に上げたせいかなと思ったりしていますが、原因がわからず。

よろしくお願いします!

イメージ説明

js

1// This file is automatically compiled by Webpack, along with any other files 2// present in this directory. You're encouraged to place your actual application logic in 3// a relevant structure within app/javascript and only use these pack files to reference 4// that code so it'll be compiled. 5 6 7require("@rails/ujs").start() 8require("turbolinks").start() 9require("@rails/activestorage").start() 10require("channels") 11 12 13// Uncomment to copy all static images under ../images to the output folder and reference 14// them with the image_pack_tag helper in views (e.g <%= image_pack_tag 'rails.png' %>) 15// or the `imagePath` JavaScript helper below. 16// 17 18//= require jquery3 19//= require popper 20//= require bootstrap-sprockets 21 22// const images = require.context('../images', true) 23// const imagePath = (name) => images(name, true) 24

scss

1 2 //@import "bootstrap"; 3 //@import "custom"; 4/* 5 * This is a manifest file that'll be compiled into application.css, which will include all the files 6 * listed below. 7 * 8 * Any CSS and SCSS file within this directory, lib/assets/stylesheets, or any plugin's 9 * vendor/assets/stylesheets directory can be referenced here using a relative path. 10 * 11 * You're free to add application-wide styles to this file and they'll appear at the bottom of the 12 * compiled file so the styles you add here take precedence over styles defined in any other CSS/SCSS 13 * files in this directory. Styles in this file should be added after the last require_* statement. 14 * It is generally better to create a new file per style scope. 15 * 16 *= require_tree . 17 *= require_self 18 */ 19 20
kazuki0323👍を押しています

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

ベストアンサー

Rails6では、sprocketsがなくなり、webpackを採用したので、Rails5の設定をしても動かないはずです。

Rails5の設定をしたい場合は、sprocketsを利用する。(推奨されなくなる)
Rails6の設定をしたい場合は、yarnを利用する。

といった形になるかと思います。

Rails6だと、わかりやすくまとまっているサイトがあまり見つからなかったので、下記などを参考に設定いただくと良いかと思います。

https://qiita.com/taKassi/items/56172d140d7208230e32
https://www.sejuku.net/blog/72222

投稿2019/09/11 07:47

no1knows

総合スコア3365

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

takumikai

2019/09/14 01:08

ありがとうございます!!! 記事を参考にしたら動きました
no1knows

2019/09/14 02:32

それはよかったです!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問