atom-archive / terminal

Atom Terminal package - *not currently maintained*
MIT License
232 stars 36 forks source link

Ruby installed via RVM is not detected #38

Closed rizkysyazuli closed 6 years ago

rizkysyazuli commented 10 years ago

Atom Terminal uses the system built-in Ruby. But it's supposed to use the version i install via RVM.

Running ruby -v from Terminal:

ruby 2.1.0p0 (2013-12-25 revision 44422) [x86_64-darwin13.0]

And from Atom Terminal:

ruby 2.0.0p247 (2013-06-27 revision 41674) [universal.x86_64-darwin13]

I found this when i tried to run Compass via Grunt. I got this warning message:

Warning: You need to have Ruby and Compass installed and in your system PATH for this task to work.

FYI: the Git version i install via Homebrew is not detected as well. reverts to system default Git.

AlexanderEkdahl commented 10 years ago

This is because the Atom terminal does not use the same environment as your normal Terminal. Run source ~/.bash_profile and it should behave more like the real Terminal.

anthonator commented 10 years ago

Are there any plans to make it act more like the normal terminal? Sourcing my bash profile every time I open a terminal tab defeats the quick in and out workflow I was hoping for.

forgot commented 10 years ago

Are you wanting them to mimic exactly?

I've added this to my .bash_profile:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH="$PATH:$HOME/.rvm/gems/ruby-2.1.1/bin"
export PATH="$PATH:$HOME/.rvm/bin" # Add RVM to PATH for scripting

and this to my .bashrc:

[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
export PATH=$PATH:$HOME/usr/local/bin
export PATH=$PATH:$HOME/usr/bin

Set up like that, I can quickly call rvm use your_version_here from either terminal, but it doesn't mirror.

rizkysyazuli commented 10 years ago

@anthonator i've fixed the problem. add that line: source ~/.bash_profile inside your .bashrc file. this should run that command everytime you open a new terminal window.

forgot commented 10 years ago

@rizkysyazuli Won't that escalate all non-login Bash shells to login? I'm new to all this, so I may be wrong....

rizkysyazuli commented 10 years ago

@forgot i'm not the expert on that as well, but isn't it the other way around? the .bash_profile is run at login, while .bashrc is for new terminal window (see here).

in plain english: as far as i know, we're calling all login scripts again when opening a new terminal window.

and i took example from @mathiasbynens .bashrc file. if he's doing it, i suppose it's okay :smile:

jdsimcoe commented 10 years ago

Nice work! This was super helpful.

anthonator commented 10 years ago

@rizkysyazuli Perfect! Thanks for the tip.

This may be useful as part of the README or wiki. I imagine other's would find this useful.

wesgurn commented 8 years ago

Try this https://atom.io/packages/000-project-shell-env

Can confirm it works on Mac OSX

lee-dohm commented 6 years ago

All repositories in the atom-archive organization are unmaintained and deprecated. Because of this, we are archiving this repository and closing all issues and pull requests. Thanks very much for your support and contributions!