##困っていること・前提
RailsアプリにBootstrapを導入し$やBootstrapのJavaScriptを使いたいのですが、
SyntaxErrorエラーにが発生してしまいどこが間違っているのかわりません
ご教授いただけたら幸いです。
##エラー
$ rails s => Booting Puma => Rails 6.1.3.1 application starting in development => Run `bin/rails server --help` for more startup options Exiting /Users/xxx/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/bootsnap-1.7.3/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:23:in `require': /Users/xxx/pg/Techpit/Rails/sample-app/config/environment.rb:10: syntax error, unexpected local variable or method, expecting `do' or '{' or '(' (SyntaxError) new webpack.ProvidePlugin({ ^~~~~~~ /Users/xxx/pg/Techpit/Rails/sample-app/config/environment.rb:11: syntax error, unexpected string literal, expecting => $: 'jquery/src/jquery', ^ /Users/xxx/pg/Techpit/Rails/sample-app/config/environment.rb:11: syntax error, unexpected ',', expecting end-of-input $: 'jquery/src/jquery', ^
##sample-app/config/environment.rb
# Load the Rails application. require_relative "application" # Initialize the Rails application. Rails.application.initialize! const webpack = require('webpack') environment.plugins.append( 'Provide', new webpack.ProvidePlugin({ $: 'jquery/src/jquery', jQuery: 'jquery/src/jquery', Popper: ['popper.js', 'default'] }) )

回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2021/04/18 20:54 編集
2021/04/18 21:26
2021/04/18 21:28