Please find the text as below from my terminal window. devtaa:rails chetanm$ rake test --trace (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails) ** Invoke test (first_time) ** Execute test (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activesupport) rake aborted! Malformed version number string 3.0.pre /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activesupport/Rakefile: 51 (See full trace by running task with --trace) (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionpack) rake aborted! Malformed version number string 3.0.pre /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionpack/Rakefile:106 (See full trace by running task with --trace) (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionmailer) rake aborted! Malformed version number string 3.0.pre /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionmailer/Rakefile: 56 (See full trace by running task with --trace) (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel) /usr/local/bin/ruby -I"/Users/chetanm/workspace/Mortar/Labs/RnD/rails/ activemodel/lib" -I"/Users/chetanm/workspace/Mortar/Labs/RnD/rails/ activemodel/test" "/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/ rake/rake_test_loader.rb" "test/cases/naming_test.rb" "test/cases/ observing_test.rb" "test/cases/serializeration/ json_serialization_test.rb" "test/cases/serializeration/ xml_serialization_test.rb" "test/cases/state_machine/event_test.rb" "test/cases/state_machine/machine_test.rb" "test/cases/state_machine/ state_test.rb" "test/cases/state_machine/state_transition_test.rb" "test/cases/state_machine_test.rb" "test/cases/validations/ acceptance_validation_test.rb" "test/cases/validations/ conditional_validation_test.rb" "test/cases/validations/ confirmation_validation_test.rb" "test/cases/validations/ exclusion_validation_test.rb" "test/cases/validations/ format_validation_test.rb" "test/cases/validations/ i18n_generate_message_validation_test.rb" "test/cases/validations/ i18n_validation_test.rb" "test/cases/validations/ inclusion_validation_test.rb" "test/cases/validations/ length_validation_test.rb" "test/cases/validations/ numericality_validation_test.rb" "test/cases/validations/ presence_validation_test.rb" "test/cases/validations_test.rb" Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ rake_test_loader Started ........................EE..................................EEEE....EE..EE..EE..EE..EE..EE..EEEE..EE..E..EE..EE..EE....................................................................E........EEE.................EEEEEEE.EE...............EEEEE..........EEEEEE.EEE............................... Finished in 0.793663 seconds. 1) Error: test_should_return_the_state_of_the_first_matching_transition_it_finds (EventBeingFiredTest): NameError: undefined local variable or method `stub'' for #<EventBeingFiredTest:0x19c9590> ./test/cases/state_machine/event_test.rb:44:in `test_should_return_the_state_of_the_first_matching_transition_it_finds'' /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ cases/../../lib/../../activesupport/lib/active_support/testing/ setup_and_teardown.rb:62:in `__send__'' /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ cases/../../lib/../../activesupport/lib/active_support/testing/ setup_and_teardown.rb:62:in `run'' 2) Error: test_should_create_StateTransitions(EventTest): NoMethodError: undefined method `expects'' for ActiveModel::StateMachine::StateTransition:Class ___________________ some text is cut to keep this message short _________________________________ 57) Error: test_should_fail_equality_check_if_to_are_not_the_same (StateTransitionTest): NameError: undefined local variable or method `stub'' for #<StateTransitionTest:0x19cbbec> ./test/cases/state_machine/state_transition_test.rb:39:in `test_should_fail_equality_check_if_to_are_not_the_same'' /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ cases/../../lib/../../activesupport/lib/active_support/testing/ setup_and_teardown.rb:62:in `__send__'' /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ cases/../../lib/../../activesupport/lib/active_support/testing/ setup_and_teardown.rb:62:in `run'' 58) Error: test_should_pass_equality_check_if_from_and_to_are_the_same (StateTransitionTest): NameError: undefined local variable or method `stub'' for #<StateTransitionTest:0x19cbbb0> ./test/cases/state_machine/state_transition_test.rb:17:in `test_should_pass_equality_check_if_from_and_to_are_the_same'' /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ cases/../../lib/../../activesupport/lib/active_support/testing/ setup_and_teardown.rb:62:in `__send__'' /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ cases/../../lib/../../activesupport/lib/active_support/testing/ setup_and_teardown.rb:62:in `run'' 293 tests, 832 assertions, 0 failures, 58 errors rake aborted! Command failed with status (1): [/usr/local/bin/ruby -I"/Users/chetanm/ work...] (See full trace by running task with --trace) (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activeresource) rake aborted! Malformed version number string 3.0.pre /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activeresource/Rakefile: 67 (See full trace by running task with --trace) (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activerecord) rake aborted! Malformed version number string 3.0.pre /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activerecord/Rakefile: 181 (See full trace by running task with --trace) (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/railties) rake aborted! Malformed version number string 3.0.pre /Users/chetanm/workspace/Mortar/Labs/RnD/rails/railties/Rakefile:151 (See full trace by running task with --trace) rake aborted! Errors in activesupport, actionpack, actionmailer, activemodel, activeresource, activerecord, railties /Users/chetanm/workspace/Mortar/Labs/RnD/rails/Rakefile:22 /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'' /usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'' /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 /usr/local/bin/rake:19:in `load'' /usr/local/bin/rake:19 devtaa:rails chetanm$
Eloy Duran
2009-Aug-06 10:38 UTC
Re: NameError: undefined local variable or method `stub''
Iirc you have to update RubyGems to accept those weird version strings. A warning would be nice though, or a normal version string… Eloy On Aug 6, 2009, at 8:53 AM, cmittal wrote:> > Please find the text as below from my terminal window. > > devtaa:rails chetanm$ rake test --trace > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails) > ** Invoke test (first_time) > ** Execute test > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activesupport) > rake aborted! > Malformed version number string 3.0.pre > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activesupport/Rakefile: > 51 > (See full trace by running task with --trace) > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionpack) > rake aborted! > Malformed version number string 3.0.pre > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionpack/Rakefile:106 > (See full trace by running task with --trace) > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionmailer) > rake aborted! > Malformed version number string 3.0.pre > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/actionmailer/Rakefile: > 56 > (See full trace by running task with --trace) > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel) > /usr/local/bin/ruby -I"/Users/chetanm/workspace/Mortar/Labs/RnD/rails/ > activemodel/lib" -I"/Users/chetanm/workspace/Mortar/Labs/RnD/rails/ > activemodel/test" "/usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/ > rake/rake_test_loader.rb" "test/cases/naming_test.rb" "test/cases/ > observing_test.rb" "test/cases/serializeration/ > json_serialization_test.rb" "test/cases/serializeration/ > xml_serialization_test.rb" "test/cases/state_machine/event_test.rb" > "test/cases/state_machine/machine_test.rb" "test/cases/state_machine/ > state_test.rb" "test/cases/state_machine/state_transition_test.rb" > "test/cases/state_machine_test.rb" "test/cases/validations/ > acceptance_validation_test.rb" "test/cases/validations/ > conditional_validation_test.rb" "test/cases/validations/ > confirmation_validation_test.rb" "test/cases/validations/ > exclusion_validation_test.rb" "test/cases/validations/ > format_validation_test.rb" "test/cases/validations/ > i18n_generate_message_validation_test.rb" "test/cases/validations/ > i18n_validation_test.rb" "test/cases/validations/ > inclusion_validation_test.rb" "test/cases/validations/ > length_validation_test.rb" "test/cases/validations/ > numericality_validation_test.rb" "test/cases/validations/ > presence_validation_test.rb" "test/cases/validations_test.rb" > Loaded suite /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake/ > rake_test_loader > Started > ........................EE..................................EEEE....EE..EE..EE..EE..EE..EE..EEEE..EE..E..EE..EE..EE....................................................................E........EEE.................EEEEEEE.EE...............EEEEE..........EEEEEE.EEE............................... > Finished in 0.793663 seconds. > > 1) Error: > test_should_return_the_state_of_the_first_matching_transition_it_finds > (EventBeingFiredTest): > NameError: undefined local variable or method `stub'' for > #<EventBeingFiredTest:0x19c9590> > ./test/cases/state_machine/event_test.rb:44:in > ` > test_should_return_the_state_of_the_first_matching_transition_it_finds > '' > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ > cases/../../lib/../../activesupport/lib/active_support/testing/ > setup_and_teardown.rb:62:in `__send__'' > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ > cases/../../lib/../../activesupport/lib/active_support/testing/ > setup_and_teardown.rb:62:in `run'' > > 2) Error: > test_should_create_StateTransitions(EventTest): > NoMethodError: undefined method `expects'' for > ActiveModel::StateMachine::StateTransition:Class > > ___________________ some text is cut to keep this message short > _________________________________ > > > > 57) Error: > test_should_fail_equality_check_if_to_are_not_the_same > (StateTransitionTest): > NameError: undefined local variable or method `stub'' for > #<StateTransitionTest:0x19cbbec> > ./test/cases/state_machine/state_transition_test.rb:39:in > `test_should_fail_equality_check_if_to_are_not_the_same'' > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ > cases/../../lib/../../activesupport/lib/active_support/testing/ > setup_and_teardown.rb:62:in `__send__'' > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ > cases/../../lib/../../activesupport/lib/active_support/testing/ > setup_and_teardown.rb:62:in `run'' > > 58) Error: > test_should_pass_equality_check_if_from_and_to_are_the_same > (StateTransitionTest): > NameError: undefined local variable or method `stub'' for > #<StateTransitionTest:0x19cbbb0> > ./test/cases/state_machine/state_transition_test.rb:17:in > `test_should_pass_equality_check_if_from_and_to_are_the_same'' > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ > cases/../../lib/../../activesupport/lib/active_support/testing/ > setup_and_teardown.rb:62:in `__send__'' > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activemodel/test/ > cases/../../lib/../../activesupport/lib/active_support/testing/ > setup_and_teardown.rb:62:in `run'' > > 293 tests, 832 assertions, 0 failures, 58 errors > rake aborted! > Command failed with status (1): [/usr/local/bin/ruby -I"/Users/ > chetanm/ > work...] > > (See full trace by running task with --trace) > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activeresource) > rake aborted! > Malformed version number string 3.0.pre > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activeresource/ > Rakefile: > 67 > (See full trace by running task with --trace) > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activerecord) > rake aborted! > Malformed version number string 3.0.pre > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/activerecord/Rakefile: > 181 > (See full trace by running task with --trace) > (in /Users/chetanm/workspace/Mortar/Labs/RnD/rails/railties) > rake aborted! > Malformed version number string 3.0.pre > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/railties/Rakefile:151 > (See full trace by running task with --trace) > rake aborted! > Errors in activesupport, actionpack, actionmailer, activemodel, > activeresource, activerecord, railties > /Users/chetanm/workspace/Mortar/Labs/RnD/rails/Rakefile:22 > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in > `execute'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in > `execute'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in > `invoke_with_call_chain'' > /usr/local/lib/ruby/1.8/monitor.rb:242:in `synchronize'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in > `invoke_with_call_chain'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in > `invoke'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in > `invoke_task'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in > `top_level'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in > `each'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in > `top_level'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in > `standard_exception_handling'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in > `top_level'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in > `standard_exception_handling'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.4/bin/rake:31 > /usr/local/bin/rake:19:in `load'' > /usr/local/bin/rake:19 > devtaa:rails chetanm$ > > >
Mike Gunderloy
2009-Aug-06 10:46 UTC
Re: NameError: undefined local variable or method `stub''
My first guess on this one would be that you don''t have the current mocha gem installed. Your other issue can be, as Eloy said, solved by updating to latest RubyGems. Potentially helpful resources: http://guides.rubyonrails.org/contributing_to_rails.html http://wiki.railsbridge.org/projects/railsbridge/wiki/Pre-flight_Checklist Also the #rails-contrib channel on Freenode IRC can usually get you pretty quick help for this sort of thing. Mike On Aug 6, 2009, at 1:53 AM, cmittal wrote:> Please find the text as below from my terminal window.
Thanks for your reply guys! I installed mocha as suggested by Mike. - Chetan. On Aug 6, 3:46 pm, Mike Gunderloy <larkw...@gmail.com> wrote:> My first guess on this one would be that you don''t have the current > mocha gem installed. > > Your other issue can be, as Eloy said, solved by updating to latest > RubyGems. > > Potentially helpful resources: > > http://guides.rubyonrails.org/contributing_to_rails.htmlhttp://wiki.railsbridge.org/projects/railsbridge/wiki/Pre-flight_Chec... > > Also the #rails-contrib channel on Freenode IRC can usually get you > pretty quick help for this sort of thing. > > Mike > > On Aug 6, 2009, at 1:53 AM, cmittal wrote: > > > Please find the text as below from my terminal window.