本文介绍了尝试启动 Rails 引擎服务器时未初始化的常量 Rails::Command::Actions::APP_PATH (NameError)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

完整的错误是

~/.gem/ruby/2.4.0/gems/railties-5.1.5/lib/rails/command/actions.rb:8:in `set_application_directory!': uninitialized constant Rails::Command::Actions::APP_PATH (NameError)

我最近从 Rails 4.x 升级到 5.x.

I recently upgrade from Rails 4.x to 5.x.

推荐答案

您需要为虚拟应用程序生成(或重新生成)binstubs".

You need to generate (or regenerate) "binstubs" for the dummy application.

cd spec/dummy
bundle exec rails app:update:bin

您现在应该可以从 spec/dummy 目录启动虚拟应用程序,如下所示:

You should now be able to start the dummy application, from the spec/dummy directory, as such:

bundle exec bin/rails server

spec/dummy/script目录也可以删除.

这篇关于尝试启动 Rails 引擎服务器时未初始化的常量 Rails::Command::Actions::APP_PATH (NameError)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-28 03:23