RubyTest in Sublime Text 2

前端 未结 12 1781
逝去的感伤
逝去的感伤 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:03

    Running Sublime Text 2(2165) with RubyTest plugin. Ruby and Gems managed with rbenv (0.3.0).

    First attempt to use RubyTest gave the following error: /bin/sh: rspec: command not found

    From the command line I ran which rspec and it returned no results.

    After some digging, I read that bundle install does not put the executables in your $PATH. Alternative executable paths not picked up by shims sometimes

    In order to use the executible outside the app, I had to delete the gem installed by bundler and then install it manually.

    gem uninstall rspec

    gem install rspec

    followed by

    rbenv rehash (Note you will need to run bundle inside your app so it updates the location of the gem)

    This had to be performed for each version of ruby I have under rbenv control.

    Now when I run

    which rspec

    it is found in the path and RubyTest is able to grab it without any problems.

    fwiw, I had to repeat the steps for cucumber as well. To use all of RubyTests' features, ruby, cucumber and rspec executables need to be in your $PATH (for rbenv it is ~/.rbenv/shims/).

提交回复
热议问题