0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

rails6 ujsをwebpacker化する

Posted at

rails-ujsで怒られていたのでujsをwebpacker化する手順を残しておきます。

#Gemfileの編集#

・Gemfileに'webpacker'を追加する

gem 'webpacker'

・Gemfileに以下の記述があれば削除

gem 'jquery-rails'

###補足~gemの削除方法~###
①bundleにで削除

$ bundle exec gem uninstall GemName

②Gemfileから削除

③Gemfile.lockから削除
terminalにて
bundle update or bundle installでGemfile.lockの中身を更新する

#webpackerのインストール#

$ ./bin/rails webpacker:install

#rails-ujsのインストール#

yarn add @rails/ujs

私はこれで怒られることはなくなりましたが
至らない点がきっとあると思うので
またわかり次第追記をしていこうと思います

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?