I am new to the Mac and wanted to use the noexec gem https://github.com/joshbuddy/noexec. On its Github page, it says to put a line RUBYOPT=”-rnoexec” to .profile file or wherever ones puts his environmental variables. Now I do know that there’s this .bash_profile file under ~/, is this also where one can put the env vars? —
Also, how can one tell which files are capable of setting env vars?
My mac installation is brand new, I haven’t done anything to the shell (b/c I don’t know how).
Thank you!
PS:
the reason why I am asking here instead of just go ahead and try it on the .bash_profile is because I had done so but then when I used “guard start” from the Guard gem, it still says “WARNING: You are using Guard outside of Bundler, this is dangerous and may not work. Using bundle exec guard is safer.
” So I take that the noexec isn’t in place. UNLESS I am mistaken that noexec’s functionality.
My two cents is to skip noexec for now for beginners, because it relies on your environment.
Bundler will have this feature built in quite soon.
But if you really want to do it… you can put environment variables in any shell script, and even on any command line. Typically the file ~/.bash_profile is run automatically when you sign in (if you use bash) so it’s a good place to put that RUBYOPT line.
Be aware that other scripts can override RUBYOPT, or choose not to use it.