Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to fix 'Please run rails webpacker: install Error: No such file or directory @ rb_sysopen"?

I am attempting to create my first Ruby on Rails application following the documentation outlined on the website. When I attempted to run the server with 'rails server' from the cmd line I receive this error...

C:/Ruby/rubyinstaller-2.5.5-1-x64/rubyinstaller-2.5.5-1-x64/lib/ruby/gems/2.5.0/gems/webpacker-4.0.7/lib/webpacker/configuration.rb:91:in `rescue in load': Webpacker configuration file not found C:/Users/{username}/Desktop/Projects/Ruby on Rails/Blog Application/blog/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - C:/Users/{username}/Desktop/Projects/Ruby on Rails/Blog Application/blog/config/webpacker.yml

OS: Windows 10
Yarn version: 1.17.3
Node.js version - v10.15.3
Rails version - 6.0.0
Ruby version - Ruby 2.5.5p157 (2019-03-15 revision 67260) [x64-mingw32]
sqlite3 version - 3.22.0

I expect for the server to run successfully and to open localhost:3000 to Yay! You're on rails

like image 786
Dominic Norton Avatar asked Aug 21 '19 00:08

Dominic Norton


People also ask

How do I install Webpacker?

To add Webpacker to an existing project, add the webpacker gem to the project's Gemfile , run bundle install , and then run bin/rails webpacker:install . The installation also calls the yarn package manager, creates a package. json file with a basic set of packages listed, and uses Yarn to install these dependencies.

What is Javascript_pack_tag?

Method: Webpacker::Helper#javascript_pack_tagCreates a script tag that references the named pack file, as compiled by webpack per the entries list in package/environments/base. js. By default, this list is auto-generated to match everything in app/javascript/packs/*. js.


1 Answers

You may want to install yarn and then recreate your application if rails webpacker:install doesn't work.

like image 76
Lone Lunatic Avatar answered Oct 18 '22 18:10

Lone Lunatic