Rspec and rspec-rails install hell

I am attending a training course covering rspec. I am using a MS
WinXPpro SP3
machine. I have installed the cygwin environment. I am using git
1.5.4. I am
using ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32] and rails
2.0.2
(albeit rails 2.1.0 is installed as well)

I had to install rspec-rails and rspec via git and as a gem.

Problem 1.

If one goes to the rspec.info website and links through to download one
sees:

From source (at github)

BUT! If one tries to install via git-clone form this repository one sees
this!

C:\temp>git clone GitHub - dchelimsky/rspec: Behaviour Driven Development framework for Ruby
/tmprspec
Initialized empty Git repository in /tmprspec/.git/
Cannot get remote repository information.
Perhaps git-update-server-info needs to be run there?

Poking around one finds buried under Documentation >> Spec::Rails >>
Install
a link to github wherein one sees this:

Install RSpec’s edge for rails <= 2.0.2

cd vendor/plugins
git clone git://github.com/dchelimsky/rspec.git
git clone git://github.com/dchelimsky/rspec-rails.git
cd …/…/
script/generate rspec

The git repository works.

But, this leads to problem 2.

ruby script/generate rspec
Couldn’t find ‘rspec’ generator

Now What???!!!

So, poking around the googlespace I find reference to gem install
rspec_generator so, I do that:

gem install rspec_generator
Successfully installed rspec-0.5.15
Successfully installed rspec_generator-0.5.15
2 gems installed
Installing ri documentation for rspec-0.5.15…
Installing RDoc documentation for rspec-0.5.15…

rspec-0.5.15 ???

Ok, now I have

  1. rspec-0.5.15
  2. rspec-1.1.4

installed and the latest from github in my project, which is required
because
I need rspec-rails. So, I run ruby script/generate rspec and then I
encounter:

Problem 3.

rake spec
(in C:/temp/tmprspec)
C:/temp/labs/08_rspec_rails/prag_hotel/vendor/plugins/rspec-rails/lib/spec/rails
/version.rb:11: (RuntimeError)
############################################################################
Your RSpec on Rails plugin is incompatible with your installed RSpec.

RSpec : 20080526202855
RSpec on Rails : 20080608062339

Make sure your RSpec on Rails plugin is compatible with your RSpec gem.
See http://rspec.rubyforge.org/documentation/rails/install.html for
details.
############################################################################

Bearing in mind that I have JUST THIS INSTANT installed both the gem
rspec and
the plugins this leaves me somewhat nonplussed. However, sycn problems
do
happen so now I do this:

gem uninstall rspec

Select gem to uninstall:

  1. rspec-0.5.15
  2. rspec-1.1.4
  3. All versions

3

You have requested to uninstall the gem:
rspec-0.5.15
rspec_generator-0.5.15 depends on [rspec (= 0.5.15)]
If you remove this gems, one or more dependencies will not be met.
Continue with Uninstall? [Yn] y
Successfully uninstalled rspec-0.5.15
Successfully uninstalled rspec-1.1.4
Remove executables:
spec, spec_translator

in addition to the gem? [Yn] y
Removing spec
Removing spec_translator

Which leads to

Problem 5.

C:\temp\labs\08_rspec_rails\prag_hotel>rake spec
(in C:/temp/labs/08_rspec_rails/prag_hotel)
rake aborted!
no such file to load – spec/rake/spectask
C:/temp/labs/08_rspec_rails/prag_hotel/rakefile:10
(See full trace by running task with --trace)

So, can anybody tell me if Rspec even runs on Windows any more?


*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:[email protected]
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3

On Jun 11, 2008, at 1:53 PM, James B. Byrne wrote:

I am attending a training course covering rspec.

Cool - I’d like to hear about it.

Install RSpec’s edge for rails <= 2.0.2

Successfully installed rspec_generator-0.5.15
installed and the latest from github in my project, which is
/version.rb:11: (RuntimeError)
############################################################################
Your RSpec on Rails plugin is incompatible with your installed RSpec.

RSpec : 20080526202855
RSpec on Rails : 20080608062339

This was because you pulled rspec and rspec-rails at different times.
Make sure you always update both at the same time.

the plugins this leaves me somewhat nonplussed. However, sycn

in addition to the gem? [Yn] y
no such file to load – spec/rake/spectask
C:/temp/labs/08_rspec_rails/prag_hotel/rakefile:10
(See full trace by running task with --trace)

So, can anybody tell me if Rspec even runs on Windows any more?

What a drag - sorry you went through all that. rspec_generator-0.5.15
and rspec-0.5.15 are old, old, old and unrelated to anything useful
today. Get rid of them.

Here’s what I’d do:

Make sure you do not have any rspec related plugins in vendor/plugins
and follow the directions from the wiki again:

cd vendor/plugins
git clone git://github.com/dchelimsky/rspec.git
git clone git://github.com/dchelimsky/rspec-rails.git
cd …/…/
script/generate rspec

There’s no reason that shouldn’t work.

Cheers,
David

On Jun 11, 2008, at 1:53 PM, James B. Byrne wrote:

Problem 1.

If one goes to the rspec.info website and links through to download
one sees:

From source (at github)

GitHub - dchelimsky/rspec: Behaviour Driven Development framework for Ruby
Home · dchelimsky/rspec-rails Wiki · GitHub

Ah - doco problem - that was not intended to be download links, but
information links. I’ll make that more clear.

Message: 1
Date: Wed, 11 Jun 2008 14:07:36 -0500
From: David C. [email protected]

What a drag - sorry you went through all that. rspec_generator-0.5.15 and
rspec-0.5.15 are old, old, old and unrelated to anything useful today.
Get
rid of them.

Here’s what I’d do:

Make sure you do not have any rspec related plugins in vendor/plugins and
follow the directions from the wiki again:

cd vendor/plugins
git clone git://github.com/dchelimsky/rspec.git
git clone git://github.com/dchelimsky/rspec-rails.git
cd …/…/
script/generate rspec

There’s no reason that shouldn’t work.

This is what I am experiencing now:

C:\temp\labs\08_rspec_rails\prag_hotel>gem list | grep rspec*
C:\temp\labs\08_rspec_rails\prag_hotel>
C:\temp\labs\08_rspec_rails\prag_hotel>
C:\temp\labs\08_rspec_rails\prag_hotel>git clone
git://github.com/dchelimsky/rsp
ec.git vendor/plugins/rspec
Initialized empty Git repository in
/cygdrive/c/temp/labs/08_rspec_rails/prag_ho
tel/vendor/plugins/rspec/.git/
remote: Counting objects: 46856, done.
remote: Compressing objects: 100% (10654/10654), done.
remote: Total 46856 (delta 33558), reused 46856 (delta 33558)
Receiving objects: 100% (46856/46856), 6.00 MiB | 56 KiB/s, done.
Resolving deltas: 100% (33558/33558), done.

C:\temp\labs\08_rspec_rails\prag_hotel>git clone
git://github.com/dchelimsky/rsp
ec-rails.git vendor/plugins/rspec-rails
Initialized empty Git repository in
/cygdrive/c/temp/labs/08_rspec_rails/prag_ho
tel/vendor/plugins/rspec-rails/.git/
remote: Counting objects: 46582, done.
remote: Compressing objects: 100% (10669/10669), done.
remote: Total 46582 (delta 33273), reused 46582 (delta 33273)
Receiving objects: 100% (46582/46582), 5.95 MiB | 69 KiB/s, done.
Resolving deltas: 100% (33273/33273), done.

C:\temp\labs\08_rspec_rails\prag_hotel>script/generate rspec
‘script’ is not recognized as an internal or external command,
operable program or batch file.

C:\temp\labs\08_rspec_rails\prag_hotel>ruby script/generate rspec
exists spec
identical spec/spec_helper.rb
identical spec/spec.opts
identical spec/rcov.opts
identical script/spec_server
identical script/spec
exists stories
identical stories/all.rb
identical stories/helper.rb

C:\temp\labs\08_rspec_rails\prag_hotel>
C:\temp\labs\08_rspec_rails\prag_hotel>rake spec
(in C:/temp/labs/08_rspec_rails/prag_hotel)
rake aborted!
no such file to load – spec/rake/spectask
C:/temp/labs/08_rspec_rails/prag_hotel/rakefile:10
(See full trace by running task with --trace)

C:\temp\labs\08_rspec_rails\prag_hotel>gem install rspec
Bulk updating Gem source index for: http://gems.rubyforge.org/
Successfully installed rspec-1.1.4
1 gem installed
Installing ri documentation for rspec-1.1.4…
Installing RDoc documentation for rspec-1.1.4…

C:\temp\labs\08_rspec_rails\prag_hotel>rake spec
(in /cygdrive/c/temp/labs/08_rspec_rails/prag_hotel)
/cygdrive/c/temp/labs/08_rspec_rails/prag_hotel/vendor/plugins/rspec-rails/lib/s
pec/rails/version.rb:11: (RuntimeError)
############################################################################
Your RSpec on Rails plugin is incompatible with your installed RSpec.

RSpec : 20080526202855
RSpec on Rails : 20080608062339

Make sure your RSpec on Rails plugin is compatible with your RSpec gem.
See http://rspec.rubyforge.org/documentation/rails/install.html for
details.
############################################################################

C:\temp\labs\08_rspec_rails\prag_hotel>gem uninstall rspec
Successfully uninstalled rspec-1.1.4
Remove executables:
spec, spec_translator

in addition to the gem? [Yn] n
Executables and scripts will remain installed.

C:\temp\labs\08_rspec_rails\prag_hotel>rake spec
(in /cygdrive/c/temp/labs/08_rspec_rails/prag_hotel)
rake aborted!
no such file to load – spec/rake/spectask
/cygdrive/c/temp/labs/08_rspec_rails/prag_hotel/rakefile:10
(See full trace by running task with --trace)

Here is the problem. If RSpec gem is not installed then I get the
rspec-rails
/ rspec version mismatch. If I remove the RSpec gem then the rake tasks
will
not run.

Suggestions welcome.


*** E-Mail is NOT a SECURE channel ***
James B. Byrne mailto:[email protected]
Harte & Lyne Limited http://www.harte-lyne.ca
9 Brockley Drive vox: +1 905 561 1241
Hamilton, Ontario fax: +1 905 561 0757
Canada L8E 3C3

On Jun 13, 2008, at 11:27 AM, James B. Byrne wrote:

script/generate rspec
ec.git vendor/plugins/rspec
git://github.com/dchelimsky/rsp
C:\temp\labs\08_rspec_rails\prag_hotel>script/generate rspec
‘script’ is not recognized as an internal or external command,
operable program or batch file.

That one is a windows problem - guess you gotta use the ruby command.

C:\temp\labs\08_rspec_rails\prag_hotel>
C:\temp\labs\08_rspec_rails\prag_hotel>rake spec
(in C:/temp/labs/08_rspec_rails/prag_hotel)
rake aborted!
no such file to load – spec/rake/spectask
C:/temp/labs/08_rspec_rails/prag_hotel/rakefile:10
(See full trace by running task with --trace)

C:\temp\labs\08_rspec_rails\prag_hotel>gem install rspec

pec/rails/version.rb:11: (RuntimeError)
############################################################################
(in /cygdrive/c/temp/labs/08_rspec_rails/prag_hotel)
not run.
For some reason rails is not finding rspec in vendor/plugins. Don’t
know why.

To get things running, you can just go into rspec-rails/lib/spec/rails/
version.rb and comment the code that’s complaining about the version
mismatch. The risk is fairly low at this point that you’re going to
have any trouble.

If you don’t want to do that - try checking out the 1.1.4 version of
spec-rails, so starting clean (no rspec anywhere) you would do this:

gem install rspec
cd vendor/plugins
git clone git://github.com/dchelimsky/rspec-rails.git
cd rspec-rails
git checkout 1.1.4

Now you should have the same versions of the rspec gem and rspec-rails
plugin.

Let us know if that works.

Hi,

I updated my rspec and rspec-rails plugins from 1.1.3 to 1.1.4

Doing script/generate rspec, seemed to have worked, but now when I want
to run rake spec, I get the following error message:

/usr/local/ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require’: no such file to load – spec/rails
(MissingSourceFile)

Indeed rails is missing from the spec/ folder. What happened? If I copy
it by hand will it work?

I found where the bug was coming from:

I initialize my plugins using:

For my default config:
config.plugins = [ :some_plugin ]

For my development environment:
config.plugins = [ :all ]

For some strange reason, rspec doesn’t like this statement, so when I
remove them all, the it now works.

Argh, installing rspec in a fresh new rails app worked. I guess
something got borked in the upgrade process.

I have one last problem. Now autotest only executes tests that sit in
test/ folder, and doesn’t seem to run the specs.

How do I correct that?

Is it normal behavior that when a test fails, I get an error message at
the end such as:

rake aborted!
Command /usr/local/ruby/bin/ruby -I"…

When all the tests pass, I don’t get any error message though. But
having this error message when a test fails makes me feel that there was
an error in the ruby script.

Thank you very much for ./script/autospec, it works perfectly now.

that’s actually good - mine is broken an will only run specs.

use script/autospec to run specs.

now you can run both at once!

On 23 Sep 2008, at 23:03, Fernando P. wrote:

I have one last problem. Now autotest only executes tests that sit in
test/ folder, and doesn’t seem to run the specs.

How do I correct that?

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


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

cheers,
Matt

http://blog.mattwynne.net

In case you wondered: The opinions expressed in this email are my own
and do not necessarily reflect the views of any former, current or
future employers of mine.