Skip to content

Instantly share code, notes, and snippets.

@fny
Forked from pmarreck/Ruby.sublime-build
Last active April 21, 2023 21:19
Show Gist options
  • Save fny/8008316 to your computer and use it in GitHub Desktop.
Save fny/8008316 to your computer and use it in GitHub Desktop.
# Get Sublime Text to use your rvm ruby without hardcoding a `$USER`.
#
# Include the configurations below the commend in the appropriate file listed below:
#
# - OS X ST2: ~/Library/Application Support/Sublime Text 2/Packages/Ruby/Ruby.sublime-build
# - OS X ST3: ~/Library/Application Support/Sublime Text 3/Packages/User/Ruby.sublime-build
# - Linux ST2: ~/.config/sublime-text-2/Packages/Ruby/Ruby.sublime-build
# - 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"
}
@jerweb63
Copy link

This is what I was looking for. Thank you.

@mdsrosa
Copy link

mdsrosa commented Jul 11, 2015

Thank you!

@rlopzc
Copy link

rlopzc commented Mar 12, 2016

Not working :/

@tsboh
Copy link

tsboh commented Apr 3, 2017

Not working :/

@fjfish
Copy link

fjfish commented Nov 3, 2017

For not working - did you shut down SE and try again?

@ronilaukkarinen
Copy link

Not working for me either. Shutting down Sublime Text and trying again doesn't help. Related issue.

@lzap
Copy link

lzap commented Sep 5, 2018

The regexp is no longer valid for Ruby 2.0, here is working version but I have a project path hardcoded since I work with many Rails Engines as subprojects: https://gist.github.com/lzap/761c86111c0c14fe6e140c267a5626bb

@lzap
Copy link

lzap commented Sep 5, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment