RubyTest in Sublime Text 2

前端 未结 12 1750
逝去的感伤
逝去的感伤 2020-12-12 16:24

I am trying to get RubyTest to work in Sublime Text 2. I followed the Instruction on the Github Readme and get the following error. Does anyone know how I could fix this?

相关标签:
12条回答
  • 2020-12-12 17:07

    The following steps worked for me (I encountered the same error as OP):

    1. Install the RubyTest plugin through the package control manager. Note* If you don't have the package manager installed - I highly recommend it for managing sublime plugins - more info here.

    2. Be sure to add the code here to your RubyTest.sublime-settings file. This file can be found at (from the menu): Preferences -> Package settings -> RubyTest -> Settings User

    3. Save file, close Sublime and restart Sublime from the terminal in your project's folder using (so PATH is available in Sublime): subl .

    0 讨论(0)
  • 2020-12-12 17:07

    I'm using rbenv and found that adding the following to my .bashrc did the trick

    /Users/user/.rbenv/shims/rspec
    
    0 讨论(0)
  • 2020-12-12 17:12

    To get this to work you only need to change one setting in the RubyTest package in sb2.

    If you are using rvm, your rspec gem is installed through rvm and is not found in /bin/sh

    So you need to set the RubyTest package for Sublime Text 2 to automatically check for your rvm environment variables.

    What to change:

    1) In Sublime Text 2, go to Preferences|Browse Packages. This will open up your packages directory.

    2) Open the 'RubyTest' directory and look for the file 'RubyTest.sublime-settings'.

    3) find the line that says:

    "check_for_rvm": false,
    

    and change it to:

    "check_for_rvm": true,
    

    save the change.

    4) That's it. It should now work.

    Good Luck

    0 讨论(0)
  • 2020-12-12 17:14

    Try change the path to usr/local/bin/

    I wrote a post on Sublime Text Build Scripts which should show you how to do this.

    http://wesbos.com/sublime-text-build-scripts/

    0 讨论(0)
  • 2020-12-12 17:14

    I had the same problem after installing RubyTest by cloning from the repo. I simply uninstalled and reinstalled the package inside Sublime using Package Control, then everything worked fine.

    0 讨论(0)
  • 2020-12-12 17:15

    Same issue for me. With rspec 1.3.2 what I just did to fix it is to edit the RubyTest.sublime.settings file in the plugin folder, changing the "ruby_rspec_exec" key from:

    "ruby_rspec_exec": "rspec"
    

    to

    "ruby_rspec_exec": "spec"
    

    It really depends on the location where you have your rspec executable file...

    0 讨论(0)
提交回复
热议问题