rails: App generator fails with webpacker error
Steps to reproduce
Expected behavior
using:
rails new project --edge --database=postgresql --skip=turbolinks --skipt-test
Actual behavior
rails webpacker:install
RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment
rails aborted!
Webpacker configuration file not found /Users/jorge/Projects/craiglist2/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /Users/jorge/Projects/craiglist2/config/webpacker.yml
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:95:in `rescue in load'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:91:in `load'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:88:in `data'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:84:in `fetch'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:23:in `source_path'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/railtie.rb:94:in `block in <class:Engine>'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:32:in `instance_exec'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:32:in `run'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:60:in `run_initializers'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/application.rb:363:in `initialize!'
/Users/jorge/Projects/craiglist2/config/environment.rb:5:in `<main>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.2.0/lib/zeitwerk/kernel.rb:23:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `block in require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/application.rb:339:in `require_environment!'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/application.rb:515:in `block in run_tasks_blocks'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/command.rb:48:in `invoke'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/commands.rb:18:in `<main>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `block in require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `require'
/Users/jorge/Projects/craiglist2/bin/rails:9:in `<top (required)>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/jorge/Projects/craiglist2/bin/spring:15:in `require'
/Users/jorge/Projects/craiglist2/bin/spring:15:in `<top (required)>'
./bin/rails:3:in `load'
./bin/rails:3:in `<main>'
Caused by:
Errno::ENOENT: No such file or directory @ rb_sysopen - /Users/jorge/Projects/craiglist2/config/webpacker.yml
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:92:in `read'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:92:in `read'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:92:in `load'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:88:in `data'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:84:in `fetch'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/configuration.rb:23:in `source_path'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/webpacker-2cef2fd6c208/lib/webpacker/railtie.rb:94:in `block in <class:Engine>'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:32:in `instance_exec'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:32:in `run'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:61:in `block in run_initializers'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/initializable.rb:60:in `run_initializers'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/application.rb:363:in `initialize!'
/Users/jorge/Projects/craiglist2/config/environment.rb:5:in `<main>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/zeitwerk-2.2.0/lib/zeitwerk/kernel.rb:23:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `block in require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/application.rb:339:in `require_environment!'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/application.rb:515:in `block in run_tasks_blocks'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/commands/rake/rake_command.rb:23:in `block in perform'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/commands/rake/rake_command.rb:20:in `perform'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/command.rb:48:in `invoke'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/railties/lib/rails/commands.rb:18:in `<main>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:22:in `block in require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/loaded_features_index.rb:92:in `register'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require_with_bootsnap_lfi'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/bootsnap-1.4.5/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:30:in `require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `block in require'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:291:in `load_dependency'
/Users/jorge/.rvm/gems/ruby-2.6.5/bundler/gems/rails-e01bf7f88f7d/activesupport/lib/active_support/dependencies.rb:325:in `require'
/Users/jorge/Projects/craiglist2/bin/rails:9:in `<top (required)>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `load'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client/rails.rb:28:in `call'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client/command.rb:7:in `call'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/client.rb:30:in `run'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/bin/spring:49:in `<top (required)>'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `load'
/Users/jorge/.rvm/gems/ruby-2.6.5/gems/spring-2.1.0/lib/spring/binstub.rb:11:in `<top (required)>'
/Users/jorge/Projects/craiglist2/bin/spring:15:in `require'
/Users/jorge/Projects/craiglist2/bin/spring:15:in `<top (required)>'
./bin/rails:3:in `load'
./bin/rails:3:in `<main>'
Tasks: TOP => app:template => environment
(See full trace by running task with --trace)
System configuration
Rails version: 6.0 Ruby version: 2.6.5
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 18 (13 by maintainers)
Yes, it must be running after project creation
rails new ...
— skip errors, anyway, the project already will be created.rails webpacker:install
, decline our existing webpacker.yml overwrite@JorgeDDW is right, I reproduced the issue
This same webpacker errors occurs under Rails 6.0.2.1 and webpacker 4.2.2 with a brand new
rails new
(no arguments other than the app name) generated application anytimebin/rails
is called (even without arguments):rails command stacktrace
To be fair, I’m experimenting with a weird setup in which I’m using the macOS system Ruby (hence
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0
in the trace) and I’ve setup bundler to install tovendor/bundle
. Here’s the repro app as-is although it’s a stock Rails 6.0.2.1 app aside from the specificbundle install --path vendor/bundle
instruction.Small info from a rails newcomer: on Friday 8th 2019 the default
rails new blog
from the rails getting started was working. Today Tuesday 12th 2019 the defaultrails new blog
is no more working. Should we update the getting started guide with the temporary solution so that new users right now are not bitten by this bug?PS: I use the standard rails command, not edge, just the default rails command of 6.0.1 (current stable).
Released 4.2.0
Thanks for raising the issue, it seems to have worked when I tested locally after release but I can reproduce now. Will look into it.
As a temporary solution you can create and fill webpacker.yml manually and run
rails webpacker:install
again.