How do you change the Ruby version Sublime uses while testing. It is currently using 1.8, but I want it to use 1.9.3 which is set to my default in RVM. When I type which ruby, I get 1.9.3, but Sublime is not using it.
To set a default Ruby version with rvm, enter rvm --default use 3.0. 0 on the command line. To switch to the system ruby, enter rvm use system . To switch back to the default, rvm default .
Alternatively you can run it right there in Sublime Text. Make sure you're in Ruby mode by clicking on the language selector in the bottom-right corner of the screen. From then on, you can run it right there in Sublime by pressing Tools -> Build, or using the CTRL-B hotkey.
From this gist: https://gist.github.com/fny/8008316
Include the configuration below in the appropriate file as listed here:
Linux ST3: ~/.config/sublime-text-3/Packages/User/Ruby.sublime-build
{ "working_dir": "${project_path}", "env": { "PATH": "${HOME}/.rvm/bin:${PATH}" }, "cmd": [ "rvm-auto-ruby", "$file" ], "file_regex": "^(...?):([0-9]):?([0-9]*)", "selector": "source.ruby" }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With