I am running bash in emacs on osx and its pulling gems from a different place then terminal.app
in bash:
which gem
/usr/bin/gem
in terminal:
which gem
/opt/local/bin/gem
How do I change the bash to match terminals?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I’m guessing the
$PATHis different in the emacs bash shell. You can check it out by running this command in each.This is the lookup path used to find commands. You need to include /opt/local/bin into this.
Place that line inside of your
~/.bashrcfile and it should be picked up by bash when used in emacs (unless it is being run under a different user or something).Update:
As Singletoned mentioned in the comments, Emacs will not load the
~/.bash_profileor~/.profilebut the Terminal will. This file likely already contains thisPATHdefinition causing the two to have a different behavior.I recommend moving the PATH definition from
bash_profilefile intobashrc. However Terminal will not loadbashrcifbash_profileexists.The solution is to add this to
~/.bash_profile.You can then move everything else into
bashrcwhich will be included intobash_profile.