Why I can't debug FactoryGirl at spec files ?
Hello,
I have managed to run single tests over models spec files, but, Right-Click, and Run "course_spec", so its fine.
The problem is that if I Debug "course_spec", I have this error:
NameError: uninitialized constant FactoryGirl
What's the missing configuration to be able to debug spec files with an initialized FactoryGirl ?
Here is my Ruby Gem Enviornment:
RubyGems Environment:
RUBYGEMS VERSION: 1.8.10
RUBY VERSION: 1.9.3 (2011-10-30 patchlevel 0) [i686-linux]
INSTALLATION DIRECTORY: /home/sam/.rvm/gems/ruby-1.9.3-p0
RUBY EXECUTABLE: /home/sam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
EXECUTABLE DIRECTORY: /home/sam/.rvm/gems/ruby-1.9.3-p0/bin
RUBYGEMS PLATFORMS:
ruby
x86-linux
GEM PATHS:
/home/sam/.rvm/gems/ruby-1.9.3-p0
/home/sam/.rvm/gems/ruby-1.9.3-p0@global
GEM CONFIGURATION:
:update_sources => true
:verbose => true
:benchmark => false
:backtrace => false
:bulk_threshold => 1000
REMOTE SOURCES:
http://rubygems.org/
----------------------
IDE: JetBrains RubyMine (EAP) RM-112.291, build #RM-112.291
OS: Linux 3.0.0-12-generic[i386]
Java: 1.6.0_23-b23
RubyMine SDK Environment:
Sdk: RVM: ruby-1.9.3-p0
Sdk Version: ver.1.9.3p0 ( revision 33570) p0
Ruby Interpreter: /home/sam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby
RVM Sdk: yes, gemset:[default]
RVM Home: /home/sam/.rvm
Sdk Language Level: 1.9
Sdk Load Path:
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby/1.9.1/i686-linux
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/site_ruby
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/vendor_ruby/1.9.1
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/vendor_ruby/1.9.1/i686-linux
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/vendor_ruby
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1
/home/sam/.rvm/rubies/ruby-1.9.3-p0/lib/ruby/1.9.1/i686-linux
/home/sam/rubyMine4beta/rubystubs19
Sdk Gem paths:
file:///home/sam/.rvm/gems/ruby-1.9.3-p0/bundler/gems
file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems
file:///home/sam/.rvm/gems/ruby-1.9.3-p0@global/gems
Gems used for 'hope':
ffi (1.0.11, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ffi-1.0.11)
sass (3.1.12, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/sass-3.1.12)
coffee-script-source (1.2.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-source-1.2.0)
mail (2.3.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/mail-2.3.0)
activesupport (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/activesupport-3.1.0)
i18n (0.6.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/i18n-0.6.0)
uglifier (1.2.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/uglifier-1.2.1)
sprockets (2.0.3, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/sprockets-2.0.3)
foreigner (1.1.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/foreigner-1.1.1)
treetop (1.4.10, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/treetop-1.4.10)
haml (3.1.4, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/haml-3.1.4)
ansi (1.4.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ansi-1.4.1)
mime-types (1.17.2, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/mime-types-1.17.2)
rack (1.3.6, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rack-1.3.6)
devise (1.5.2, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/devise-1.5.2)
warden (1.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/warden-1.1.0)
diff-lcs (1.1.3, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/diff-lcs-1.1.3)
activeresource (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/activeresource-3.1.0)
sass-rails (3.1.5, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/sass-rails-3.1.5)
therubyracer (0.9.9, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/therubyracer-0.9.9)
rspec-expectations (2.7.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-expectations-2.7.0)
coffee-rails (3.1.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/coffee-rails-3.1.1)
activemodel (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/activemodel-3.1.0)
simple_form (1.5.2, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/simple_form-1.5.2)
bundler (1.0.21, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/bundler-1.0.21)
thor (0.14.6, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/thor-0.14.6)
activerecord (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/activerecord-3.1.0)
json (1.6.4, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/json-1.6.4)
coffee-script (2.2.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/coffee-script-2.2.0)
execjs (1.2.13, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/execjs-1.2.13)
turn (0.8.3, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/turn-0.8.3)
rake (0.9.2.2, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rake-0.9.2.2)
kaminari (0.13.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/kaminari-0.13.0)
rdoc (3.12, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rdoc-3.12)
rspec (2.7.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-2.7.0)
actionpack (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/actionpack-3.1.0)
rspec-rails (2.7.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-rails-2.7.0)
guard (0.10.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/guard-0.10.0)
cocoon (1.0.15, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/cocoon-1.0.15)
libv8 (3.3.10.4, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/libv8-3.3.10.4-x86-linux)
rspec-core (2.7.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1)
jquery-rails (1.0.19, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.19)
rails (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rails-3.1.0)
rack-ssl (1.3.2, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rack-ssl-1.3.2)
arel (2.2.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/arel-2.2.1)
erubis (2.7.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/erubis-2.7.0)
rb-fsevent (0.4.3.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rb-fsevent-0.4.3.1)
builder (3.0.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/builder-3.0.0)
orm_adapter (0.0.5, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/orm_adapter-0.0.5)
rack-cache (1.0.3, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rack-cache-1.0.3)
multi_json (1.0.4, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/multi_json-1.0.4)
spork (0.9.0.rc9, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/spork-0.9.0.rc9)
tilt (1.3.3, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/tilt-1.3.3)
rack-mount (0.8.3, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rack-mount-0.8.3)
tzinfo (0.3.31, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/tzinfo-0.3.31)
validate_url (0.2.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/validate_url-0.2.0)
sqlite3 (1.3.5, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/sqlite3-1.3.5)
rspec-mocks (2.7.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-mocks-2.7.0)
polyglot (0.3.3, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/polyglot-0.3.3)
railties (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/railties-3.1.0)
hike (1.2.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/hike-1.2.1)
guard-spork (0.5.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/guard-spork-0.5.0)
factory_girl_rails (1.4.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/factory_girl_rails-1.4.0)
factory_girl (2.3.2, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/factory_girl-2.3.2)
will_paginate (3.0.2, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/will_paginate-3.0.2)
rack-test (0.6.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rack-test-0.6.1)
client_side_validations (3.1.4, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/client_side_validations-3.1.4)
actionmailer (3.1.0, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/actionmailer-3.1.0)
bcrypt-ruby (3.0.1, file:///home/sam/.rvm/gems/ruby-1.9.3-p0/gems/bcrypt-ruby-3.0.1)
请先登录再写评论。
Thanks, please track http://youtrack.jetbrains.net/issue/RUBY-10194 issue.
I've checked that link, they are working on Windows, but, I am working on Ubuntu 11.10, so, shall I wait, untill the final RubyMine release is realsed ?
I cannot reproduce it. I've created a sample project with one model created by scaffold + factory_girl gem and debugger works ok.
rails 3.1.1
factory_girl 2.3.2
factory_girl_rails 1.4.0
rspec 2.8.0
Here is what I get when I try to debug spec:
/home/sam/.rvm/rubies/ruby-1.9.3-p0/bin/ruby -e at_exit{sleep(1)};$stdout.sync=true;$stderr.sync=true;load($0=ARGV.shift) /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide-0.4.17.beta8/bin/rdebug-ide --port 45896 -- /home/sam/.rvm/gems/ruby-1.9.3-p0/bin/rspec _2.8.0.rc2_ /home/sam/Documents/RoR/course_builder/spec/controllers/quiz_spec.rb --require teamcity/spec/runner/formatter/teamcity/formatter --format Spec::Runner::Formatter::TeamcityFormatter
Testing started at 8:20 PM ...
Fast Debugger (ruby-debug-ide 0.4.17.beta8, ruby-debug-base 0.11.30.pre4) listens on 127.0.0.1:45896
/home/sam/Documents/RoR/course_builder/spec/controllers/quiz_spec.rb:3:in `<top (required)>': uninitialized constant QuizzesController (NameError)
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide-0.4.17.beta8/lib/ruby-debug-ide.rb:127:in `debug_load'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide-0.4.17.beta8/lib/ruby-debug-ide.rb:127:in `debug_program'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide-0.4.17.beta8/bin/rdebug-ide:95:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
/home/sam/Documents/RoR/course_builder/spec/controllers/quiz_spec.rb:3:in `<top (required)>': uninitialized constant QuizzesController (NameError)
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `block in load_spec_files'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `map'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/configuration.rb:459:in `load_spec_files'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/command_line.rb:18:in `run'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:80:in `run_in_process'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:69:in `run'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/rspec-core-2.7.1/lib/rspec/core/runner.rb:10:in `block in autorun'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide-0.4.17.beta8/lib/ruby-debug-ide.rb:127:in `debug_load'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide-0.4.17.beta8/lib/ruby-debug-ide.rb:127:in `debug_program'
from /home/sam/.rvm/gems/ruby-1.9.3-p0/gems/ruby-debug-ide-0.4.17.beta8/bin/rdebug-ide:95:in `<top (required)>'
from -e:1:in `load'
from -e:1:in `<main>'
Process finished with exit code 1
Empty test suite.