升级到Rails 4.2后,我很高兴尝试新集成的网络控制台,但我遇到了一些问题。
在Rails 4.2的发行说明中,它提到:"使用Rails 4.2生成的新应用程序现在默认带有Web控制台gem。"
由于我升级到4.2,我认为这意味着我仍然需要在我的Gemfile中指定它。如果不将它添加到我的Gemfile中,rails只会给我"未定义的局部变量或方法`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>'
我用Google搜索并没有找到太多东西。非常感谢任何建议。
谢谢!
答案 0 :(得分:6)
事实证明,我的问题来自依赖&#39; debug_inspector&#39;。
感谢:https://github.com/banister/binding_of_caller/issues/39
我必须跑:
$ gem uninstall debug_inspector
$ bundle install