I have a Ruby project and I'd like to run the scripts directly from Sublime Text in place of having to run them in the terminal. I'm running Ubuntu 12.04 LTS if that matters at all.
From the terminal I need to be located in the project root to make the script work:
$ ruby path/to/file/file.rb
If I try to run it from where the file is located it fails because they are requiring files from various places in the project.
If I run the script in Sublime Text (Ctrl + Shift + B) it fails the same way as I'm running it from the file location.
How do I do this? I suspect this can be solved with a custom build but I've been unsuccessful until now. Any help appreciated.