ruby -v
: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]which ruby
: /home/iuser/.rbenv/shims/rubyrails -v
: Rails 4.2.3subl -v
: Sublime Text Build 3126- Ubuntu: Ubuntu 16.04.1 LTS
It doesn't matter from which directory I launch the Sublime Text 3 from, as long as I launch it using subl
from terminal, I am able to build any Ruby code, using the Ctrl + B
even when the settings are the Tools > Build System > Automatic.
However, when I launch the same Sublime Text 3 from Ubuntu Dash, I am not able to build Ruby Code, and I get the following error:
/bin/bash: ruby: command not found
[Finished in 0.0s with exit code 127]
[shell_cmd: ruby "/home/iuser/Desktop/1.rb"]
[dir: /home/iuser/Desktop]
[path:/home/iuser/bin:/home/iuser/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin]
Even though $PATH
returns:
bash: /home/iuser/.rbenv/plugins/ruby-build/bin:/home/iuser/.rbenv/shims:/home/iuser/.rbenv/bin:/home/iuser/bin:/home/iuser/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:
I was able to overcome this by making a custom build system which pointed to the rbenv and then changing the Sublime Text 3 Tools > Build System > MyCustomBuild (http://snakelab.cc/2014/12/10/sublime_3_and_rbenv.html)
My question is:
Why do I need to make a custom build system, and why its not picking up the rbenv just like the Sublime Text 3 which is started from terminal?
How can I make changes so that no matter where I start the Sublime Text 3 from, even if the build system is set to Automatic, it always builds the ruby code?
.bashrc
which add ruby to your PATH. If you add stuff to your PATH, use.profile
for it.