upgrade to rails 6

101 views
Skip to first unread message

fugee ohu

unread,
Oct 14, 2019, 6:44:26 PM10/14/19
to Ruby on Rails: Talk
to upgrade an app to rails 6 i should run `yarn add <requirement>' for everything that was listing as "//= require <requirement>" ?

Ariel Juodziukynas

unread,
Oct 14, 2019, 6:50:53 PM10/14/19
to rubyonra...@googlegroups.com
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

El lun., 14 oct. 2019 19:44, fugee ohu <fuge...@gmail.com> escribió:
to upgrade an app to rails 6 i should run `yarn add <requirement>' for everything that was listing as "//= require <requirement>" ?

--
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 rubyonrails-ta...@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.

fugee ohu

unread,
Oct 14, 2019, 7:16:47 PM10/14/19
to Ruby on Rails: Talk


On Monday, October 14, 2019 at 6:50:53 PM UTC-4, Ariel Juodziukynas wrote:
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

El lun., 14 oct. 2019 19:44, fugee ohu <fuge...@gmail.com> escribió:
to upgrade an app to rails 6 i should run `yarn add <requirement>' for everything that was listing as "//= require <requirement>" ?

--
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.

When I run yarn install it doesn't create a /public/packs folder and that's the cause of my 

Webpacker::Manifest::MissingEntryError error? Because the manifest file isn't found?

Ariel Juodziukynas

unread,
Oct 14, 2019, 7:53:21 PM10/14/19
to rubyonra...@googlegroups.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

To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-ta...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/da0ad727-e0d7-4796-ba49-2c5fbe4a68c6%40googlegroups.com.

fugee ohu

unread,
Oct 14, 2019, 8:03:05 PM10/14/19
to Ruby on Rails: Talk

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
Reply all
Reply to author
Forward
0 new messages