Rspec 1.1.2 on Windows

I am using Rspec 1.1.2 on Windows XP SP2

I am receiving the following error when I run ‘rake spec’ from a brand
new
project:
C:/SVN_Projects/rspec/vendor/plugins/rspec/lib/spec/runner/options.rb:107:in
`colour=': You must gem install win32console to use colour on Windows
(RuntimeError)

I have the win32console gem installed and the error still occurs. It
seems
that the require statement in options.rb line 105 is throwing an
exception
and I am not sure why. I have even gone to the extent of replacing
‘Win32/Console/ANSI’ with the absolute path to the ANSI file and still
no
luck. When I run the require statement in a console everything works
fine
and dandy.

Now if I remove the --colour option from the spec.opts file then it
doesn’t
need the win32console gem; however, I then receive this error:
C:/ruby/lib/ruby/gems/1.8/gems/activesupport-1.3.1/lib/active_support/dependencies.rb:100:in
`const_missing’: uninitialized constant Spec::Rails (NameError)

I do have the rspec_on_rails plugin installed. Can anyone offer me any
suggestions on how to troubleshoot this issue? Thanks in advance!

View this message in context:
http://www.nabble.com/Rspec-1.1.2-on-Windows-tp15006297p15006297.html
Sent from the rspec-users mailing list archive at Nabble.com.

On Jan 21, 2008 6:53 PM, BenFyvie [email protected] wrote:

that the require statement in options.rb line 105 is throwing an exception
I do have the rspec_on_rails plugin installed. Can anyone offer me any
suggestions on how to troubleshoot this issue? Thanks in advance!

I’ll be looking into this tonight, since I already reported that, but
using rake and spec command only:

http://rspec.lighthouseapp.com/projects/5645/tickets/244-no-coloured-output-on-windows-due-missing-rubyopt

It seems that --colour affects not only lib/runner/options.rb, but
other places too.

Maybe we should change the behavior for windows and revert to false if
Win32/Console/ANSI is not found instead of raising a exception.

David, Aslak?


Luis L.
Multimedia systems

A common mistake that people make when trying to design
something completely foolproof is to underestimate
the ingenuity of complete fools.
Douglas Adams

Luis L. wrote:

(RuntimeError)

using rake and spec command only:

[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Thanks Luis,

I used the code in your lighthouse case and I am now able to load the
win32console gem. However I am still not able to run tests because of
the
second problem I that I mentioned before with the uninitialized constant
for
Spec::Rails. I see at least one other person with this problem, but no
resolution. Installation Trouble - RSpec - Ruby-Forum

Care to help me troubleshoot this issue as well? I’ve got the
rspec_on_rails plugin installed and my spec_helper.rb is requiring
spec/rails.

Thanks!


View this message in context:
http://www.nabble.com/Rspec-1.1.2-on-Windows-tp15006297p15022159.html
Sent from the rspec-users mailing list archive at Nabble.com.

On Jan 22, 2008 2:08 PM, BenFyvie [email protected] wrote:

Thanks Luis,

I used the code in your lighthouse case and I am now able to load the
win32console gem. However I am still not able to run tests because of the
second problem I that I mentioned before with the uninitialized constant for
Spec::Rails. I see at least one other person with this problem, but no
resolution. Installation Trouble - RSpec - Ruby-Forum

It’s weird since I had done the same step mentioned in that post and
couldn’t reproduce the problem.

Tried with and without rspec gem installed. Also tried using
script/spec, without problems.

Care to help me troubleshoot this issue as well? I’ve got the
rspec_on_rails plugin installed and my spec_helper.rb is requiring
spec/rails.

by CURRENT rspec tag, you mean the 1.1.2 release? can you ditch
vendor/plugins/rspec and rspec_on_rails and try again?

It’s truly odd.

Can you try removing the spec.opts, spec_helper files and ran the
rspec generator again?


Luis L.
Multimedia systems

A common mistake that people make when trying to design
something completely foolproof is to underestimate
the ingenuity of complete fools.
Douglas Adams

Luis L. wrote:

for
Care to help me troubleshoot this issue as well? I’ve got the
rspec generator again?
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

Thanks for your quick response Luis!

I’ve actually gone to the extent of creating a brand spankin new rails
project, installed the plugins, ran the bootstrap, created a simple
table
with a simple test and I get the same problem. Anything else you can
think
to try?

View this message in context:
http://www.nabble.com/Rspec-1.1.2-on-Windows-tp15006297p15023061.html
Sent from the rspec-users mailing list archive at Nabble.com.

Luis L. wrote:

for
Care to help me troubleshoot this issue as well? I’ve got the
rspec generator again?
rspec-users mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/rspec-users

It appears the second error was my fault. The new project I created was
using Rails 1.1.6 I created a new project using Rails 2.0.2 and
everything
seems to work once I put in your patch for the win32console gem.
Thanks!

View this message in context:
http://www.nabble.com/Rspec-1.1.2-on-Windows-tp15006297p15023560.html
Sent from the rspec-users mailing list archive at Nabble.com.

On Jan 22, 2008 2:58 PM, BenFyvie [email protected] wrote:

Thanks for your quick response Luis!

I’ve actually gone to the extent of creating a brand spankin new rails
project, installed the plugins, ran the bootstrap, created a simple table
with a simple test and I get the same problem. Anything else you can think
to try?

Ben, will be helpful if you provide information about versions of
every part you’re using:

  • Ruby version (ruby -v) One-Click Installer?
  • RubyGems version (gem -v) (0.9.4, 1.0.1)?
  • Rails gem version (rails -v)
  • How you installed RSpec and RSpec On Rails (as plugins, using
    CURRENT or what REL)?
  • Is the win32console gem installed?
  • The exact command you used to run the specs (rake spec, script/spec,
    or just spec).

Also, please read my comments on this ticket:

http://rspec.lighthouseapp.com/projects/5645/tickets/244-no-coloured-output-on-windows-due-missing-rubyopt

If you have RubyGems 0.9.5, please update to 1.0.1 or revert to 0.9.4,
since that specific version is broken for Windows, as I commented
there and linked to my blog:

http://blog.mmediasys.com/2007/12/19/latest-rubygems-and-rails-is-a-deadly-combo/

HTH,

Luis L.
Multimedia systems

A common mistake that people make when trying to design
something completely foolproof is to underestimate
the ingenuity of complete fools.
Douglas Adams