Rails 4.2 web-console问题

5
升级到Rails 4.2后,我很兴奋地想尝试新集成的Web控制台,但是出现了一些问题。
在Rails 4.2的发布说明中,它提到:“生成于Rails 4.2的新应用程序默认带有Web控制台gem。”
由于我已经升级到4.2,我认为这意味着我仍然需要在我的Gemfile中指定它。如果没有将它添加到我的Gemfile中,rails会给我“undefined local variable or method 'console'”,因此我认为确实是这样的。
一旦我将gem 'web-console', '~> 2.0'添加到Gemfile中,并运行rails服务器,我现在得到:
/home/kevin/.rvm/gems/ruby-2.1.5/gems/binding_of_caller-0.7.3.pre1/lib/binding_of_caller/mri2.rb:21:in `callers': uninitialized constant RubyVM::DebugInspector (NameError)
  from /home/kevin/.rvm/gems/ruby-2.1.5/gems/better_errors-2.0.0/lib/better_errors/exception_extension.rb:7:in `set_backtrace'
  from /home/kevin/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:in `require'
  from /home/kevin/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:76:in `block (2 levels) in require'
  from /home/kevin/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:in `each'
  from /home/kevin/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:72:in `block in require'
  from /home/kevin/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:in `each'
  from /home/kevin/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler/runtime.rb:61:in `require'
  from /home/kevin/.rvm/gems/ruby-2.1.5@global/gems/bundler-1.7.6/lib/bundler.rb:133:in `require'
  from /home/kevin/workspace/applications/ems-heroes/config/application.rb:6:in `<top (required)>'
  from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `require'
  from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:78:in `block in server'
  from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
  from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
  from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
  from /home/kevin/.rvm/gems/ruby-2.1.5/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
  from bin/rails:4:in `require'
  from bin/rails:4:in `<main>'

我在谷歌上搜索了一下,但没有找到太多有用的信息。非常感谢您给出的任何建议。

谢谢!


1
你是否执行了“bundle dance”来完成升级?并且你是否运行了“rake rails:update”命令? - Doon
还有一个关于 web_console 和 better_errors 不起作用的问题,但错误与您的不同。 - Doon
我已经执行了bundle dance并解决了一些小问题。在你提到后,我也逐步执行了rake rails:update。但仍然没有解决这个错误 :( - kevinweaver
我唯一尝试的另一件事情是删除better_errors的temp文件,看看是否能解决这个错误,因为我不确定它们之间的兼容性如何。 - Doon
刚刚尝试了一下,但没有成功。不过还是谢谢@Doon。 - kevinweaver
1个回答

6

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接