[rspec-users] rspec and rspec-rails install hell

David Chelimsky dchelimsky at gmail.com
Fri Jun 13 12:47:22 EDT 2008


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

>> Message: 1
>> Date: Wed, 11 Jun 2008 14:07:36 -0500
>> From: David Chelimsky <dchelimsky at gmail.com>
>
>>
>> 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.

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

> 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.

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.


More information about the rspec-users mailing list