[rspec-users] rspec - undefined method `describe' for main:Object

Mano ah lists at ruby-forum.com
Sat Oct 11 02:44:11 EDT 2008


Luis Lavena wrote:
> On Fri, Oct 10, 2008 at 3:56 AM, Mano ah <lists at ruby-forum.com> wrote:
>> c:/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:28:in `ge
>>
>> describe SandboxController,"handling someaction" do
>>
>>    @value = somemethod
>>
>>  end
>>
>> end
>>
>> Please help me to solve the issue
>>
> 
> Sorry, jumping late on this issue.
> 
> It appears you're calling 'spec' from the command line, which is
> loading your installed gem of RSpec.
> 
> Based on the output of the backtrace, it appears to be version 0.5.15
> 
> You should have used "ruby script/spec" from the root of your rails
> application instead.


Thank you for the reply. I done the same and got the below error


** Invoke spec (first_time)
** Execute spec
** Invoke spec:models (first_time)
** Invoke db:test:prepare (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:test:prepare
** Invoke db:test:clone (first_time)
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump
** Invoke spec:controllers (first_time)
** Invoke db:test:prepare
** Execute spec:controllers
rake aborted!
RSpec failures
D:/Diwakar/my_spec/config/../lib/tasks/rspec.rake:13
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in 
`invoke_with_call_c
hain'
c:/ruby/lib/ruby/1.8/monitor.rb:242:in `synchronize'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in 
`invoke_with_call_c
hain'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in 
`invoke_task'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in 
`top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in 
`top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in 
`standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in 
`top_level'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in 
`standard_exceptio
n_handling'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
c:/ruby/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
c:/ruby/bin/rake:19:in `load'
c:/ruby/bin/rake:19




> 
> Also, if you changed versions of Rails, you need to update
> config/environment.rb to match the Rails gem version since you
> downgraded to 1.2.3 but forgot to change that file.
> 
> I suggest you do this:
> 
> gem install rake
> gem install rails
> gem install rspec
> gem install rspec-rails
> 
> rails my-test-app
> cd my-test-app
> ruby script/generate rspec
> rake spec
> 
> That, at least, should work and not generate empty errors (well, I've
> skipped database setup, controller and such, please add those after).
> 
> HTH,
> --
> Luis Lavena
> AREA 17
> -
> Human beings, who are almost unique in having the ability to learn from
> the experience of others, are also remarkable for their apparent
> disinclination to do so.
> Douglas Adams

-- 
Posted via http://www.ruby-forum.com/.


More information about the rspec-users mailing list