gpt4 book ai didi

ruby-on-rails - Ruby 调试不起作用

转载 作者:行者123 更新时间:2023-12-03 12:19:14 24 4
gpt4 key购买 nike

我无法让服务器以 Debug模式启动:

即使我安装了所有正确的 gem,服务器还是拒绝启动。

$ gem install ruby-debug
ERROR: Error installing ruby-debug:
rbx-require-relative requires Ruby version ~> 1.8.7.

这不起作用,其他帖子说使用ruby-debug19:
David@DAVID-PC /c/triton6 
$ gem install ruby-debug19
Successfully installed ruby-debug19-0.11.6
1 gem installed
Installing ri documentation for ruby-debug19-0.11.6...
Installing RDoc documentation for ruby-debug19-0.11.6...

David@DAVID-PC /c/triton6
$ rails server --debug
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
You need to install ruby-debug to run the server in debugging mode. With gems, use 'gem install > ruby-debug'
Exiting

知道该怎么做吗?

这是我的 Gemfile:
source 'http://rubygems.org'

gem 'rails', '3.1.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'
gem 'ruby-debug19'
gem 'execjs'
gem 'ruby-debug-ide'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end

gem 'jquery-rails'

# To use ActiveModel has_secure_password
# gem 'bcrypt-ruby', '~> 3.0.0'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug19', :require => 'ruby-debug'

group :test do
# Pretty printed test output
gem 'turn', '0.8.2', :require => false
end

最佳答案

确保您有 gem "ruby-debug19", :require => 'ruby-debug'在你的 Gemfile 中,然后运行 ​​bundle install :)

编辑:添加了重要的 :require =>声明,我之前错过了

关于ruby-on-rails - Ruby 调试不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/8351604/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com