1

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.

dessy
  • 136
  • 1
  • 7
  • I don't think it's using the same version of ruby as your console.. did you try setting the ruby version in .rbenv or in the Gemfile? – Hesham Feb 06 '15 at 16:58
  • Hey there. Thanks for the thoughts. It's using ruby 2.1.2 (`.rbenv/versions/2.1.2/`), which is the same as the ruby specified in my .ruby-version file in that directory. I'm fairly certain the ruby version it's trying for is correct. – dessy Feb 06 '15 at 20:13
  • ok.. this might be worth trying - scroll to the first answer: http://stackoverflow.com/questions/23669651/sublime-text-3-rbenv-testunit-rubytest-and-spring-correct-configuation-to-get (i know spring is not the issue in your case) – Hesham Feb 06 '15 at 20:22
  • Unfortunately, no dice on that either. Since it appears it's picking up rbenv properly (but for some reason not the gems), it just tries to run `export` on rbenv, which fails. Thanks again, though. – dessy Feb 10 '15 at 19:01

1 Answers1

2

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.

dessy
  • 136
  • 1
  • 7