upgrade to rails 6

to upgrade an app to rails 6 i should run `yarn add ’ for everything that was listing as “//= require ” ?

You shouldn’t need to do that, you could use yarn to manage JavaScript dependencies with rails 5 too. Also the assets pipeline still works the same way with rails 6, only webpacker is the default now, but you can keep the old behaviour

You shouldn’t need to do that, you could use yarn to manage JavaScript dependencies with rails 5 too. Also the assets pipeline still works the same way with rails 6, only webpacker is the default now, but you can keep the old behaviour

to upgrade an app to rails 6 i should run `yarn add ’ for everything that was listing as “//= require ” ?

You received this message because you are subscribed to the Google Groups “Ruby on Rails: Talk” group.

To unsubscribe from this group and stop receiving emails from it, send an email to rubyonra...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/c28d3d35-5c90-4228-bdb6-236268bf5f09%40googlegroups.com.

You are mixing webpack with yarn. The only use of yarn is to download javascript packages from https://yarnpkg.com/lang/en/ to your app’s node_modules folder. Webpacker is a gem that uses Webpack which is an assets manager/packer solution similar (but with conceptually different approach) to Sprockets (known as the rails’ assets pipeline). Both Webpack and Sprockets can use the node_modules folder to find the required files.

You can use webpacker or sprockets on rails projects, you can even use both at the same time, the only difference between rails 5 and 6 is that 5 defaults to sprockets and 6 defaults to webpacker for new projects. You don’t have to migrate to webpack if you don’t want to, you should be able to upgrade to rails 6 without using webpack and everything should work as before.

Yarn won’t create the /packs folder, webpacker should do that, maybe you didn’t configure webpacker correctly or you didn’t run the webpacker compiler. I suggest you follow the official webpacker guide to understand it https://github.com/rails/webpacker#installation

Thanks for clarifying I ran bin/webpack to find out what was borked and it said webpack-cli needed to be installed and prompted me to install it Do you want to install ‘webpack-cli’ (yes/no):

then the public/packs folder with manifest.json was created

after that i had to add babel-cli to satisfy a few node modules that use it