0

只是想知道是否有人可以请建议。

直到今天,我一直在 Aptana Studio 中进行调试工作。现在它停止工作了。我不确定为什么。

  • Rails3.0.7
  • 红宝石 1.9.3p448
  • OSX 狮子

现在,当我尝试启动调试器时,我在控制台中得到以下信息:

Fast Debugger (ruby-debug-ide 0.4.18, ruby-debug-base19x 0.11) listens on 127.0.0.1:49858
Uncaught exception: undefined method `source' for main:Object
    /Users/pj/railsprojects/researchers.ie/Gemfile:1:in `<top (required)>'
    /Users/pj/.rvm/gems/ruby-1.9.3-p448/bin/rdebug-ide:23:in `load'
    /Users/pj/.rvm/gems/ruby-1.9.3-p448/bin/rdebug-ide:23:in `<main>'

那么,看起来它失去了读取 Gemfile 的能力?

在我的 Gemfile 中,前几行是:

source 'http://rubygems.org'

gem 'rails', '3.0.7'

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

gem 'mysql2'
gem 'devise'
gem 'omniauth', '0.1.6'

gem 'compass', '>= 0.10.6'
gem 'haml'
gem 'html5-boilerplate'

它似乎被挂在第一行......

现在,我下载了 RubyMine 进行试用,它能够毫无问题地调试同一个项目。

所以,不知道为什么 Aptana Studio 会出现问题。但这可能与命令行调试也不起作用有关...当我执行“rails server -debugger”时,出现如下错误:

=> Booting WEBrick
=> Rails 3.0.7 application starting in bugger on http://0.0.0.0:3000
You did not specify how you would like Rails to report deprecation notices for your bugger environment, please set config.active_support.deprecation to :log, :notify or :stderr at config/environments/bugger.rb
/Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:62:in `establish_connection': bugger database is not configured (ActiveRecord::AdapterNotSpecified)
    from /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.0.7/lib/active_record/connection_adapters/abstract/connection_specification.rb:55:in `establish_connection'
    from /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/activerecord-3.0.7/lib/active_record/railtie.rb:59:in `block (2 levels) in <class:Railtie>'
    from /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.0.7/lib/active_support/lazy_load_hooks.rb:36:in `instance_eval'
    from /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.0.7/lib/active_support/lazy_load_hooks.rb:36:in `execute_hook'
    from /Users/pj/.rvm/gems/ruby-1.9.3-p448/gems/activesupport-3.0.7/lib/active_support/lazy_load_hooks.rb:43:in `block in run_load_hooks'

任何帮助将不胜感激。谢谢

下面是我的 gem 列表输出。在这个阶段我已经安装了我可以找到的所有调试 gem:

aaronh-chronic (0.3.9) 摘要 (1.0.0) actionmailer (4.0.0, 3.0.12, 3.0.7, 3.0.5) actionpack (4.0.0, 3.0.12, 3.0.7, 3.0.5) activemodel (4.0.0, 3.0.12, 3.0.7, 3.0.5) activerecord (4.0.0, 3.0.12, 3.0.7, 3.0.5) activerecord-deprecated_finders (1.0.3) activeresource (3.0.12, 3.0.7, 3.0.5) activesupport (4.0.0, 3.0.12, 3.0.7, 3.0.5) addressable (2.2.4) annotate (2.4.0) archive-tar-minitar (0.5.2) arel ( 4.0.0, 2.0.10) atomic (1.1.13) bcrypt-ruby (2.1.4) bigdecimal (1.1.0) builder (3.1.4, 2.1.2) bundler (1.3.5) bundler-unload (1.0. 1) capistrano (2.5.21) coffee-rails (4.0.0) coffee-script (2.2.0) coffee-script-source (1.6.3) columnize (0.3.6) compass (0.10.6) 守护进程 (1.1. 4) 调试器 (1.6.1) 调试器-linecache (1.2.0) 调试器-ruby_core_source (1.2.3) devise (1.1.8) diff-lcs (1.1.2) erubis (2.7.0, 2.6.6) eventmachine (0.12.10) execjs (2.0.1) factory_girl (1.3.3) factory_girl_rails (1.0) faker (0.3. 1) faraday (0.5.7) gravatar_image_tag (1.0.0.pre2) haml (3.0.25) haml-rails (0.3.4) highline (1.6.1) hike (1.2.3) hpricot (0.8.4) html5-样板 (0.3.2) i18n (0.6.5, 0.5.0) io-console (0.3) jbuilder (1.5.1) jquery-rails (3.0.4) json (1.8.0, 1.6.6, 1.5.5) linecache19 (0.5.12) linkedin (0.2.2) mail (2.5.4, 2.2.20, 2.2.19) mime-types (1.25, 1.24, 1.18, 1.16) minitest (4.7.5, 2.5.1) mocha ( 0.9.12) multi_json (1.7.9, 0.0.5) multipart-post (1.1.0) mysql2 (0.2.6) net-ldap (0.1.1) net-scp (1.0.4) net-sftp (2.0. 5) net-ssh (2.1.4) net-ssh-gateway (1.0.1) nifty-generators (0.4.5) nokogiri (1.4.4) oa-basic (0.1.6) oa-core (0.1.6) oa-企业 (0.1.6) oa-oauth (0.1.6) oa-openid (0.1.6) oauth (0.4.4) oauth2 (0.1.1) omniauth (0.1.6) polyglot (0.3.3, 0.3.1) pyu-ruby-sasl (0.0.3.2) rack (1.5.2, 1.2.8, 1.2.5, 1.2.3) rack-mount ( 0.6.14) rack-openid (1.2.0) rack-test (0.6.2, 0.5.7) railroady (1.1.1) rails (4.0.0, 3.0.12, 3.0.7, 3.0.5) railties ( 4.0.0, 3.0.12, 3.0.7, 3.0.5) rake (10.1.0, 0.9.2.2, 0.9.2, 0.8.7) rbx-require-relative (0.0.9) rdoc (3.12.2, 3.12, 3.9.5) rest-client (1.6.1) riddle (1.5.7) rspec (2.6.0, 2.5.0) rspec-core (2.6.4, 2.5.1) rspec-expectations (2.6.0, 2.5.0) rspec-mocks (2.6.0, 2.5.0) rspec-rails (2.6.1, 2.5.0)9) rdoc (3.12.2, 3.12, 3.9.5) rest-client (1.6.1) riddle (1.5.7) rspec (2.6.0, 2.5.0) rspec-core (2.6.4, 2.5.1) rspec-expectations (2.6.0, 2.5.0) rspec-mocks (2.6.0, 2.5.0) rspec-rails (2.6.1, 2.5.0)9) rdoc (3.12.2, 3.12, 3.9.5) rest-client (1.6.1) riddle (1.5.7) rspec (2.6.0, 2.5.0) rspec-core (2.6.4, 2.5.1) rspec-expectations (2.6.0, 2.5.0) rspec-mocks (2.6.0, 2.5.0) rspec-rails (2.6.1, 2.5.0) ruby-debug-base19 (0.11.25) ruby​​-debug-base19x (0.11.30.pre14, 0.11.30.pre12) ruby​​-debug-ide (0.4.18, 0.4.17) ruby​​-debug19 (0.11.6) ruby-openid (2.1.8) ruby​​-openid-apps-discovery (1.2.0) ruby​​_core_source (0.1.5) ruby​​_parser (2.0.6) ruby​​gems-bundler (1.2.2) ruby​​ntlm (0.1.1) rvm (1.11. 3.8) sass (3.2.10) sass-rails (4.0.0) sdoc (0.3.20) sexp_processor (3.0.5) spork (0.9.0.rc8) sprockets (2.10.0) sprockets-rails (2.0.0) sqlite3 (1.3.8, 1.3.4, 1.3.3) thin (1.2.11) thinking-sphinx (2.0.14) thor (0.18.1, 0.14.6) thread_safe (0.1.2)tilt (1.4.1) treetop (1.4.15, 1.4.10, 1.4.9) turbolinks (1.3.0) tzinfo (0.3.37, 0.3.32, 0.3.27) uglifier (2.2.1)warden (1.0.3) webrat (0.7. 1) 无论何时 (0.6.8) will_paginate (3.0.pre2)

4

2 回答 2

0

事实证明,这是一场巨大的野鹅追逐。Aptana UI 非常混乱。如果您想通过 Rails 应用程序进行调试,请不要单击工具栏中的调试符号。

相反,您转到左侧的项目资源管理器并单击齿轮图标并选择调试服务器。

于 2013-09-17T15:45:45.383 回答
0

试试 rails s --debugger,它对我有用。

于 2015-05-10T22:51:55.680 回答