Following this tutorial I am stepping into odd errors in the very first steps.
After running:
rails new rails-react-tutorial --webpack=react
I would then try after bundle install
rails webpacker:install:react rails generate react:installyarn install
And I will get:
[DEPRECATION] The trollop gem has been renamed to optimist and will no longer be supported. Please switch to optimist as soon as possible.
rails aborted!
ArgumentError: Malformed version number string Yarn v0.1.1 2011 Jesper Kjeldgaard
/*/rails-react-tutorial/bin/rails:9:in `<top (required)>'
/*/rails-react-tutorial/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
Tasks: TOP => webpacker:install:react => webpacker:verify_install => webpacker:check_yarn
(See full trace by running task with --trace)
After checking this issue, I have removed the yarn files in the bin paths for the gems as it's advised in the last comments versions/2.6.1/lib/ruby/gems/2.6.0/gems/yarn-0.1.1/lib/yarn.rb
, but then I get errors like:
rails webpacker:install:react
rails aborted!
LoadError: cannot load such file -- /*/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/yarn-0.1.1/lib/yarn.rb
/*/rails-react-tutorial/config/application.rb:7:in `<main>'
/*/rails-react-tutorial/Rakefile:4:in `<main>'
/*/rails-react-tutorial/bin/rails:9:in `<top (required)>'
/*/rails-react-tutorial/bin/spring:15:in `<top (required)>'
bin/rails:3:in `load'
bin/rails:3:in `<main>'
So that will force me to install the gem again. I am using Rails 6.0.2.1-v and ruby 2.6.1p33 (2019-01-30 revision 66950) [x86_64-linux].