【问题标题】:Need to install ruby-debug to run the server in debugging mode需要安装 ruby​​-debug 以调试模式运行服务器
【发布时间】:2018-05-08 09:39:14
【问题描述】:

我有一个使用 Ruby 1.9.3p327 和 Rails 3.2.11 的 Ruby on Rails 应用程序。我正在尝试为 Sublime Text 使用 Ruby 调试器插件。我安装了“调试器”gem。我的项目中没有“ruby-debug19”gem。这是我的 Gemfile 中的一个 sn-p。

group :development do
  gem 'debugger'
end

我的 Gemfile.lock 有:

debugger (1.6.1)
      columnize (>= 0.3.1)
      debugger-linecache (~> 1.2.0)
      debugger-ruby_core_source (~> 1.2.3)
    debugger-linecache (1.2.0)
    debugger-ruby_core_source (1.2.3)

当我尝试启动 Webrick 时,

rails s -e development --debugger

打印错误:

You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'

我读到这个问题是由“ruby-debug”gem引起的,解决方案是改用“debugger”gem,但这正是我正在做的。

【问题讨论】:

  • 愚蠢的问题 - 你安装了 gem 还是将它添加到你的 gemfile 中?
  • 如果没有,则运行“gem install ruby​​-debug”或“bundle install”来安装 gemfile 中的所有 gem
  • 你有什么问题?
  • @Mark 调试器 gem 已安装。如果我运行“gem list -l”,我可以在列表中看到它:
  • @sawa 我的问题是:即使我根据 Ruby 和 Rails 版本安装了“调试器 gem”,为什么 Ruby 还要我提供“ruby-debug”gem?

标签: ruby-on-rails ruby rubygems ruby-debug


【解决方案1】:

@马克

Fetching: hashie-3.5.7.gem (100%)
Successfully installed hashie-3.5.7
Fetching: powerbar-1.0.18.gem (100%)
Successfully installed powerbar-1.0.18
Fetching: minitar-0.6.1.gem (100%)
The `minitar` executable is no longer bundled with `minitar`. If you are
expecting this executable, make sure you also install `minitar-cli`.
Successfully installed minitar-0.6.1
Fetching: minitar-cli-0.6.1.gem (100%)
Successfully installed minitar-cli-0.6.1
Fetching: archive-tar-minitar-0.6.1.gem (100%)
'archive-tar-minitar' has been deprecated; just install 'minitar'.
Successfully installed archive-tar-minitar-0.6.1
Fetching: ruby_core_source-0.1.5.gem (100%)
Successfully installed ruby_core_source-0.1.5
Fetching: linecache19-0.5.12.gem (100%)
Building native extensions.  This could take a while...
Successfully installed linecache19-0.5.12
Fetching: ruby-debug-base19-0.11.25.gem (100%)
Building native extensions.  This could take a while...
Successfully installed ruby-debug-base19-0.11.25
Fetching: ruby-debug19-0.11.6.gem (100%)
ruby-debug19's executable "rdebug" conflicts with debugger
Overwrite the executable? [yN]  y

这是 gem install ruby​​-debug19 的输出

我也加了

group :development do
  gem 'ruby-debug'
end

到我的 Gemfile 然后运行:

bundle install

不幸的是,当我跑步时:

rails s -e development --debugger

同样的错误发生

You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install ruby-debug'

【讨论】:

    猜你喜欢
    • 2014-05-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-20
    相关资源
    最近更新 更多