vim-rspec icon indicating copy to clipboard operation
vim-rspec copied to clipboard

zsh:1: command not found: spec

Open regedarek opened this issue 13 years ago • 8 comments

When I try to run RunSpecs i receive this error.

regedarek avatar Jan 25 '12 23:01 regedarek

Please try to make sure spec is in your path. try: which spec. If using from a project that uses rvm, try to make sure you start your vim from that directory

~➤ which spec spec not found

~/myproject ✗ ➤ which spec ruby-1.8.7-p249@x3 /Users/yan/.rvm/gems/ruby-1.8.7-p249@x3/bin/spec

skwp avatar Jan 25 '12 23:01 skwp

I get spec not found I have ruby 1.9.2 and using gvim but i have spec/ dir and spec_helper.rb there I have .rvmrc with -> environment_id="ruby-1.9.2-p290"

regedarek avatar Jan 26 '12 01:01 regedarek

If you are outside of vim and you run spec and that doesn't work, then this plugin can't magically make it work :) Is that what i'm hearing? Try to do a gem install rspec --version 1.3.0

skwp avatar Jan 26 '12 01:01 skwp

To clarify, you must be able to run

spec spec/some_spec.rb

from your command line. if that works, and vim doesn't work, then we have some path problem between the command line and vim. if however that line doesn't work, then you have a system problem of not locating the spec binary, which is outside the scope of this plugin

skwp avatar Jan 26 '12 01:01 skwp

im using rspec 2, is possible to use this plugin with rspec2? when i tried to install rspec 1.3.0 i recieve errors

[error]: ParserSyntaxError: syntax error in `features/interop/rspec_output.feature`:(1,8): syntax error, unexpected ':', expecting $end
[error]: Stack trace:
    /home/rege/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.4/lib/yard/parser/ruby/ruby_parser.rb:505:in `on_parse_error'
    /home/rege/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.4/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /home/rege/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.4/lib/yard/parser/ruby/ruby_parser.rb:49:in `parse'
    /home/rege/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.4/lib/yard/parser/ruby/ruby_parser.rb:15:in `parse'
    /home/rege/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.4/lib/yard/parser/source_parser.rb:438:in `parse'
    /home/rege/.rvm/gems/ruby-1.9.2-p290/gems/yard-0.7.4/lib/yard/parser/source_parser.rb:361:in `parse_in_order'

when i run rspec spec/ it works..

spec spec/                                                                                                                                                                                  2:20:32
zsh: command not found: spec

I tried install rspec 1.3.0 but this not solving the problem.

gem list

rspec (2.8.0)
rspec-core (2.8.0, 2.7.1, 2.6.4)
rspec-expectations (2.8.0, 2.7.0, 2.6.0)
rspec-mocks (2.8.0, 2.7.0, 2.6.0)
rspec-rails (2.8.1, 2.7.0, 2.6.1)

I aliased spec='rspec' in zshrc but this not solve the problem too :P then when i run spec spec/ all works but not in vim :)

regedarek avatar Jan 26 '12 01:01 regedarek

I myself don't use the plugin for rspec2 so I haven't had time to make sure it works 100%. I have heard that it does from another contributor. It should theoretically find the 'rspec' command if it's in your path. Can you do which rspec from the directory from which you launch vim?

skwp avatar Jan 26 '12 06:01 skwp

I can confirm with ruby 1.9.3, rspec-2.8.0 that it does find the (correct) path on the cli but not with this plugin. I can as well do :!rspec spec in command-mode. Only the plugin is not able to find the right path.

which rspec shows ~/rvm/gems/ruby-1.9.3-p0@rails32/bin/rspec both in vim and on cli.

ohcibi avatar Feb 21 '12 18:02 ohcibi

You should use https://github.com/tpope/vim-rvm for better rvm support within gvim. If you start your gvim from the terminal after cd-ing into your desired directory, things will be fine, otherwise, you should use tpope's rvm and call :Rvm to switch to the correct context as per your .rvmrc before you execute your tests.

dhruvasagar avatar Sep 05 '12 10:09 dhruvasagar