-
Notifications
You must be signed in to change notification settings - Fork 119
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
Rspec not found #36
Comments
Hi, does the error occures also with running the whole file? And how do you start sublime 2? Do you start it from console (http://www.sublimetext.com/docs/2/osx_command_line.html) ? Br, |
The error occurs when i run all tests as well. I aliased the command and kick is off usually from my project directory in Terminal. I just tried to start the app from the applications folder and load it that way and it produced the same result. |
Tests does not work if the Sublime is started from applications folder. But its strange that it does not work when you start it from console in you projects folder. But does it ever worked for you ? Br, |
I had linked it to a different directory. I recreated the link and started it from the terminal and tests work now. Thanks. |
This is caused (most likely) because you are using an intrusive ruby management tool, such as RVM. If you would like this to work better, I suggest using rbenv. |
I already use Rbenv. I figured out what it was already. On Jan 30, 2012, at 12:57 AM, Tejas Dinkar
|
I got this error again. I haven't changed anything. I have a shortcut created in /usr/local/bin, which is in my PATH. I got to the project from command line and run "subl ." when I run the tests using Command - Shift - R, I get "/bin/sh: rspec: command not found". When I look at the console, and see the command generated, if I type is in the console, it works fine. any ideas? |
Nevermind. I ended up just forcing Rspec to run through "bundle exec" in the user settings and it finds it now. |
Despite what I mentioned before, now it says it can't find bundle exec. I'm not sure what else to do at this point. It works right when I change it, and then it seems to break on subsequent opens. Works fine in the console Doesn't work from within Sublime. |
Hi, So you start sublime in your project folder, you have normal structure and you modified the RubyTest.sublime-settings file...when you start test CTRL + ` shows the problem : 'bundle exec' not found? If I am correct... than I have no idea whats the problem.. :D |
Yeah that's exactly the steps. Hmmm.... |
http://yehudakatz.com/2011/05/30/gem-versioning-and-bundler-doing-it-right/ Always do a bundler --binstubs and add ./bin to the start of your path On Wed, Feb 15, 2012 at 7:04 PM, Brandon Hilkert <
|
I also have this problem. Running
fixed it for me |
Hi, If rspec is not found and you are using bundler then edit file: "ruby_unit_exec": "bundle exec ruby -Itest", |
(If anyone is still interested:) Another way of setting RubyTest's path to current RVM rspec is:
|
@preadaptation agreed, that seems cleanest. It works for different Rubies being used in different projects and regardless of how your profile is set. Here's how I did the same thing for rbenv: {
"run_rspec_command": "$HOME/.rbenv/bin/rbenv exec rspec {relative_path}",
"run_single_rspec_command": "$HOME/.rbenv/bin/rbenv exec rspec {relative_path} -l{line_number}"
} It really would be nice to have RubyTest automatically use rvm or rbenv if available. |
@preadaptation that fixed things for me - thanks! |
@bronson If you want to be more specific, you can just set tings to |
@bronson thanks, that worked great for me! |
I spent many hours struggling with this same problem! I could not get rspec to run within Sublime Text 2, using the Michael Hartl "Ruby on Rails Tutorial." It kept saying /bin/sh: rspec: command not found I finally realized that the RubyTest package (https://github.com/maltize/sublime-text-2-ruby-tests) was looking in the WRONG PLACE for my RVM! On my Mac, the path for RubyTest is /Library/Application Support/Sublime Text 2/Packages/Ruby Test First, to make RubyTest seek the RVM, I changed the parameter in RubyTest.sublime-settings from "check_for_rvm": false, to "check_for_rvm": true, Then I dug into the Python code of run_ruby_test.py: https://github.com/maltize/sublime-text-2-ruby-tests/blob/master/run_ruby_test.py At line 130, inside class BaseRubyTask, it had the wrong path for my RVM: rvm_cmd = os.path.expanduser('~/.rvm/bin/rvm-auto-ruby') I changed it to the full correct path: rvm_cmd = os.path.expanduser('/usr/local/rvm/bin/rvm-auto-ruby') If this is not your path, find the correct path by typing "which rvm-auto-ruby" and substitute that instead. After saving run_ruby_test.py, I went to Terminal, cd to my Rails application directory, and ran "spork" Finally, I opened static_pages_spec.rb in Sublime Text 2. Now all the tests work from it! |
@rayning0 I'm having the exact same problem. However, for me, the solution is just simply turning on 'check_for_rvm' and leave everything else unchanged. 'check_for_rvm' : true |
Yeah, my problem was I installed RVM in the wrong place, under root (admin), instead of my user account. Thus RVM is not in the expected spot on my Mac hard drive. Just doing "check_for_rvm: true" would not work for me. |
If you are using rbenv via homebrew and rspec 3.1 use this RubyTest.sublime-settings config:
|
I fixed it in #250 |
I'm not sure this is necessarily an issue with the package, but hopefully you can help.
When i run a single rspec test, i get this output:
/bin/sh: rspec: command not found
In the console, i copy and paste the command that as created:
cd '/Users/user/Dropbox/code/app/' && rspec spec/controllers/profile_controller_spec.rb -l 163
When I run that command in Terminal, it works fine. Any why it wouldn't work from Sublime?
The text was updated successfully, but these errors were encountered: