Search code examples
sublimetext3rbenvruby-test

Running RubyTest in Sublime Text 3 throws errors


I'm using RubyTest in Sublime Text 3, opening Sublime from my terminal using the subl command, and running into the following error:

[MY_HOME_DIRECTORY]/.rbenv/versions/2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- bundler/setup

The only change I've made in my RubyTest user settings is setting "check_for_rbenv" = true. You'll notice from the error that RubyTest is picking up rbenv just fine. Along with the error, RubyTest spits out the command it's trying to run, /usr/local/bin/rbenv exec ruby -Itest test/unit/company_test.rb. Running that command directly from terminal in the directory works flawlessly.

When I change my RubyTest user settings to "check_for_bundler": true, I get the following error:

rbenv: bundle: command not found

Again, running the command /usr/local/bin/rbenv exec bundle exec ruby -Itest test/unit/company_test.rb from terminal works.

Any thoughts are very much appreciated.


Solution

  • Looks like the issue was with rbenv-gemset. Bundler was installed in a gemset, and Sublime wasn't picking it up. As soon as I removed rbenv-gemset and ran gem install bundler, everything worked as expected.