Forum: RSpec Spec Server Error on rake spec:server:start

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
3c2e4abc14123b99dda442c0e74173c8?d=identicon&s=25 Charles Grindel (Guest)
on 2009-03-23 19:29
(Received via mailing list)
Hi,

I am following the directions for setting up autotest (
http://wiki.github.com/dchelimsky/rspec/spec_serve...)
and experienced an error when I run rake spec:server:start.

$ rake spec:server:start
(in /home/cgrindel/code/it/webapp)
Starting up spec_server ...
/home/cgrindel/code/it/webapp/vendor/plugins/rspec-rails/lib/spec/rails/spec_server.rb:1:
uninitialized constant Rails (NameError)
    from script/spec_server:21:in `require'
    from script/spec_server:21

I took a quick look at the code in script/spec_server.rb.  In short, it
appears that the script requires 'spec/rails/spec_server' before the
Rails
environment is loaded which happens on line 26.  I moved the require of
'spec/rails/spec_server' after the Rails environment load.  This appears
to
have fixed this issue.

So, my first question, has anyone else seen this problem?  If not, can
anyone explain how the Rails constant should be available before the
Rails
environment is loaded?

Thanks,
Chuck
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-03-23 19:45
(Received via mailing list)
2009/3/23 Charles Grindel <chuck@chuckgrindel.com>:
> uninitialized constant Rails (NameError)
> anyone explain how the Rails constant should be available before the Rails
> environment is loaded?

Did you run "script/generate rspec" when you upgraded the plugin? If
not, please do so now, and let it rewrite everything in script/ and
lib/tasks/rspec.rake.
3c2e4abc14123b99dda442c0e74173c8?d=identicon&s=25 Charles Grindel (Guest)
on 2009-03-23 20:34
(Received via mailing list)
Hi, David,

I forgot to generate rspec after the upgrade.  That fixed the problem.
Thanks for your help.

Thanks,
Chuck
5d38ab152e1e3e219512a9859fcd93af?d=identicon&s=25 David Chelimsky (Guest)
on 2009-03-23 20:54
(Received via mailing list)
2009/3/23 Charles Grindel <chuck@chuckgrindel.com>:
> Hi, David,
>
> I forgot to generate rspec after the upgrade.  That fixed the problem.
> Thanks for your help.

Glad you got it working.

Cheers,
David
This topic is locked and can not be replied to.