Rails webrick 强制退出:未初始化的常量 WebConsole::Railtie::Middleware (NameError)
Rails webrick force-exits: uninitialized constant WebConsole::Railtie::Middleware (NameError)
所以我是 ruby 的新手,第一次尝试启动 webrick。我最近刚刚用 mysql2 修复了分段错误,并遇到了这个新的退出问题。这是命令行读数:
G:\Ruby Development\simple_cms>
G:\Ruby Development\simple_cms>rails server
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run rails server -h
for more startup options
=> Ctrl-C to shutdown server
Exiting
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.1.2/lib/web_console/railtie.rb:21:in`block in ': uninitialized constant WebConsole::Railtie::Middleware (NameError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in `each'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in `call'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from G:/Ruby Development/simple_cms/config/environment.rb:5:in `'
from G:/Ruby Development/simple_cms/config.ru:3:in `require'
from G:/Ruby Development/simple_cms/config.ru:3:in `block in '
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
from G:/Ruby Development/simple_cms/config.ru:in `new'
from G:/Ruby Development/simple_cms/config.ru:in `'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in `app'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:78:in `start'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `'
from bin/rails:4:in `require'
from bin/rails:4:in `'
据我目前的了解,我至少正在加载服务器。所以这不是分段错误的一部分,对吧?
我的 gemfile 包含 web-console 2.1.2。另外,我有 运行 'bundle install' 以防万一。对此错误有任何见解吗?让我知道是否需要更多信息。
Rails版本-4.2.1
Ruby 版本 - 2.2.1p85
有两个 rails 可执行文件。您的 PATH 将您指向错误的路径。输入 'which rails':您应该得到“~/bin/rails”,railties 放在您的主目录中的一个存根。如果您得到其他东西,请在那里重命名 rails 可执行文件,然后重试。
所以我是 ruby 的新手,第一次尝试启动 webrick。我最近刚刚用 mysql2 修复了分段错误,并遇到了这个新的退出问题。这是命令行读数:
G:\Ruby Development\simple_cms>
G:\Ruby Development\simple_cms>rails server
=> Booting WEBrick
=> Rails 4.2.1 application starting in development on http://localhost:3000
=> Run
rails server -h
for more startup options=> Ctrl-C to shutdown server
Exiting
C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/web-console-2.1.2/lib/web_console/railtie.rb:21:in`block in ': uninitialized constant WebConsole::Railtie::Middleware (NameError)
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `instance_exec'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:55:in `block in run_initializers'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:30:in `run'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:226:in `block in tsort_each'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:348:in `block (2 levels) in each_strongly_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:429:in `each_strongly_connected_component_from'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:347:in `block in each_strongly_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in `each'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in `call'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:345:in `each_strongly_connected_component'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:224:in `tsort_each'
from C:/Ruby22-x64/lib/ruby/2.2.0/tsort.rb:203:in `tsort_each'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/initializable.rb:54:in `run_initializers'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/application.rb:352:in `initialize!'
from G:/Ruby Development/simple_cms/config/environment.rb:5:in `'
from G:/Ruby Development/simple_cms/config.ru:3:in `require'
from G:/Ruby Development/simple_cms/config.ru:3:in `block in '
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `instance_eval'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:55:in `initialize'
from G:/Ruby Development/simple_cms/config.ru:in `new'
from G:/Ruby Development/simple_cms/config.ru:in `'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `eval'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:49:in `new_from_string'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/builder.rb:40:in `parse_file'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:299:in `build_app_and_options_from_config'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:208:in `app'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:61:in `app'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/rack-1.6.0/lib/rack/server.rb:336:in `wrapped_app'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:139:in `log_to_stdout'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/server.rb:78:in `start'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `tap'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:75:in `server'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from C:/Ruby22-x64/lib/ruby/gems/2.2.0/gems/railties-4.2.1/lib/rails/commands.rb:17:in `'
from bin/rails:4:in `require'
from bin/rails:4:in `'
据我目前的了解,我至少正在加载服务器。所以这不是分段错误的一部分,对吧?
我的 gemfile 包含 web-console 2.1.2。另外,我有 运行 'bundle install' 以防万一。对此错误有任何见解吗?让我知道是否需要更多信息。
Rails版本-4.2.1 Ruby 版本 - 2.2.1p85
有两个 rails 可执行文件。您的 PATH 将您指向错误的路径。输入 'which rails':您应该得到“~/bin/rails”,railties 放在您的主目录中的一个存根。如果您得到其他东西,请在那里重命名 rails 可执行文件,然后重试。