2011-12-02 91 views
3

我无法让服务器以调试模式启动:Ruby-调试不起作用

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

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

不工作,其他职位说使用红宝石debug19:

[email protected] /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... 

[email protected] /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 
+0

这段代码的新的分支已经现在正在运行,现在使用'gem'debugger''这里有一个链接,指向这个新版本的核心rails项目:https://github.com/matschaffer/knife-solo/pull/ 38 –

回答

4

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

编辑:添加了重要:require =>声明,我

之前错过
+0

不幸的是,这是行不通的: – David

+0

嗯,试试'捆绑exec轨道服务器--debug' ... – RyanWilcox

+0

nope :-(同样的错误:“使用”jem insta ll ruby​​-debug'“ – David

1

答案已经在你的Gemfile中,我想。

gem 'ruby-debug19', :require => 'ruby-debug' 
+0

errr ....让我遇到了另一个错误。现在therubyracer不会编译。 – David

+0

堆栈跟踪说什么? –

3

我有同样的问题(及以上),以获得红宝石调试中的Aptana Studio中工作3.我的设置和程序,使其工作:

  • 的Mac OS X狮子10.7.2
  • 的Aptana Studio的3(构建3.0.8.201201201658)
  • 使用RVM,在我的项目工作目录我有一个.rvmrc指出:

    rvm use [email protected] 
    

为了使红宝石调试工作的Aptana Studio中我现在有以下安装

  • 在我的Gemfile结束时,我有:

    gem "ruby-debug-base19x", "0.11.30.pre10" 
    gem 'ruby-debug-ide' 
    

注意,我m不使用ruby-debug-ide19和ruby-debug19,Aptana Studio只是拒绝使用这个gem。无论如何,它总是选择ruby-debug-ide 0.4.16。

我也没有使用ruby-debug-base19,而是使用ruby-debug-base19x。

  • 打造最新的红宝石调试base19x,请确保指定正确的红宝石背景下(包括):

    rvm [email protected] do gem install --pre ruby-debug-base19x -- --with-ruby-include=/Users/Freddy/.rvm/src/ruby-1.9.3-p0 
    

失去了RVM ...不使用RVM时做。

  • 不要忘记从项目工作目录中安装Bundle install(或bundle update)。在我的终端,当我type'Bundle清单”,对于所提到的宝石以下版本上市:

    linecache19 (0.5.13) 
    ruby-debug-base19x (0.11.30.pre10) 
    ruby-debug-ide (0.4.16) 
    
  • 重要提示:如果您有linecache19版本0.5.12,而不是.13,从下载最新版本RubyForge: ruby-debug19: Project Filelist。我下载到了我的〜/ Downloads文件夹,所以建立在我RVM情况下安装这种宝石如下:

    rvm [email protected] do gem install ~/Downloads/linecache19-0.5.13.gem -- --with-ruby-include=/Users/Freddy/.rvm/src/ruby-1.9.3-p0 
    

如果您需要安装linecache19版本0.5.13,不要忘了再次运行“软件包更新”。

  • 毕竟这最后的问题我(和它的解决方案)在IDE中运行调试器时,描述如下:

Aptana 3 ruby debugger - Exception in DebugThread loop: undefined method `is_binary_data?'

将在上面的第一个答案提供的代码xml_printer.rb中的'module Debugger'语句。

享受!

- 弗雷迪

建设红宝石1.9.3-P0的说明。这有点超出了这个问题的范围,但是由于构建这个(这也是)一个暗示。编译ruby-1.9.3.-p0给出了与openssl相关的多个编译器错误。做最好的事情是在RVM环境中安装的OpenSSL 0.9.8n包:

  • 当你的XCode 4.2安装,首先你需要把下面的你.rvmrc或.profile:

    export CC=/usr/bin/gcc-4.2 
    

不要为得到启用,例如$源〜/ .rvmrc

0

是什么让这对我的工作是:

sudo gem install ruby-debug19 
gem install linecache19 
gem install ruby-debug-base19 
bundle update 
rails server -u 
+0

在发布复制和粘贴样板/逐字回答多个问题时要小心,这些问题往往会被社区标记为“垃圾”。如果你这样做,那么它通常意味着问题是重复的,所以标记它们而不是:http://stackoverflow.com/questions/7802124 – Kev

+0

感谢您的建议,只是为了帮助,因为我真的被困在 – standup75

1

ruby​​-debug已损坏。该项目的一个新分支正在被广泛使用。这是相同的代码,只是修复。这个新版本现在是用于Rails项目核心ruby的一个版本。

这里是新的宝石: https://github.com/cldwalker/debugger

要使用它,包括它在你的宝石文件

gem 'debugger' 

下面就来提交一个链接,它被拉到导轨:

https://github.com/matschaffer/knife-solo/pull/38

+0

我已经安装了cwalker/debugger gem并将其包含在我的gemfile中。当我运行Aptana 3调试服务器时,它仍然显示:无法找到'rdebug-ide'二进制脚本。可能需要安装'ruby-debug-ide'gem,或者可能需要将您的gem可执行文件目录添加到您的PATH(通过'gem environment'查看位置)。 –

+0

你需要使用'ruby-debug-ide'吗?我没有亲自使用调试器的这一部分,也没有在我的Gemfile中使用该gem。你有没有试过把它拿出来,看看你是否可以让调试器一起工作?我只在我的gem文件中有'调试器',并且可以通过rails服务器进行调试。 –

0

这里是我的灵魂。我跟着这个帖子没有成功。 :(

我添加了下面的宝石我的Gemfile和== >>运行$bundle install ......工作

=加入的Gemfile =>gem 'ruby-debug-ide', '~> 0.4.22'

Installing ruby-debug-ide 0.4.22 
Using sass 3.2.19 
Using sass-rails 4.0.3 
Using sdoc 0.4.0 
Using spring 1.1.3 
Using sqlite3 1.3.9 
Using turbolinks 2.2.2 
Using uglifier 2.5.1 
Your bundle is complete! 
Use `bundle show [gemname]` to see where a bundled gem is installed. 
-SVE1411EGXB:~/Desktop/myapp$