Rails 6本地服务器引导:RAILS_ENV =开发环境未定义

Ruf*_*ff9 3 ruby-on-rails webpacker ruby-on-rails-6

我刚刚创建了一个新的Rails 6应用程序。一切正常,直到我尝试使用启动本地服务器rails s,并收到以下错误消息:

RAILS_ENV=development environment is not defined in config/webpacker.yml, falling back to production environment
Exiting
Run Code Online (Sandbox Code Playgroud)

Webpacker configuration file not found /Users/remy/dev/voter/config/webpacker.yml. Please run rails webpacker:install Error: No such file or directory @ rb_sysopen - /Users/remy/dev/voter/config/webpacker.yml (RuntimeError)
Run Code Online (Sandbox Code Playgroud)

但是当我跑步时,rails webpacker:install我仍然有错误。

小智 7

该错误通常暗示未满足的Yarn依赖关系。在运行之前,尝试安装或更新Yarn rails webpacker:install

以下是纱线文档,以防万一。