Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zsh:1: command not found: spec #12

Open
regedarek opened this issue Jan 25, 2012 · 8 comments
Open

zsh:1: command not found: spec #12

regedarek opened this issue Jan 25, 2012 · 8 comments

Comments

@regedarek
Copy link

When I try to run RunSpecs i receive this error.

@skwp
Copy link
Owner

skwp commented Jan 25, 2012

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

@regedarek
Copy link
Author

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"

@skwp
Copy link
Owner

skwp commented Jan 26, 2012

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
Copy link
Owner

skwp commented Jan 26, 2012

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

@regedarek
Copy link
Author

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 :)

@skwp
Copy link
Owner

skwp commented Jan 26, 2012

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?

@ohcibi
Copy link

ohcibi commented Feb 21, 2012

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.

@dhruvasagar
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants