Solving Rails 6 Webpacker Install Error in Ubuntu GNU/Linux
Hi! This Tip Try to Solve Rails 6 Webpacker Installation Error in Ubuntu GNU/Linux Desktops.
This Issue is due from the Conflict between Webpacker and Psyck Ruby Gems.
Webpacker, use Webpack to manage app-like JavaScript modules in Rails.
Psych is a YAML Parser and Emitter. Psych leverages libyaml[https://pyyaml.org/wiki/LibYAML] for its YAML parsing and emitting capabilities. In addition to wrapping libyaml, Psych also knows how to serialize and de-serialize most Ruby objects to and from the YAML format.
Finally, this Setup is valid for all the Ubuntu-based Distros like:
- Linux Mint
- Zorin OS
- Lubuntu
- Elementary OS
- Kde Neon
- Pop_OS!
- Xubuntu
- Linux Lite
- Bodhi
- Puppy
- Kubuntu
- LXLE
- Trisquel
- Voyager Ubuntu
- feren OS
- Peppermint
- Linux Ultimate Edition (You may just need to Discover what’s the Parent Release)
1. Installing NodeJs
How to Install NodeJs in GNU/Linux
Follow instructions to Setup Node.js 16 LTS!2. Fixing App
Then to Solve Rails 6 Webpacker Install Error in Ubuntu
Access Rails App Target:cd [/path/2/railsApp]
Edit the Gemfile
In case, with the nano Editor like:nano ./Gemfile
Then to manage the psych Version Append:gem 'psych', '< 4'
And again Upgrade the webpacker Gem minimum Release:gem 'webpacker', '~>5.0'
Next Update your Gems Bundle with:bundle update
Now to Setup Webpacker run:rails webpacker:install
Just confirm to Overwrite all proposed Files.
Last, Install the missing Babel Plugins:yarn add @babel/plugin-proposal-private-methods
yarn add @babel/plugin-proposal-private-property-in-object