<div dir="ltr"><div>Assuming you're using OS X – which based on the `/Library` in your GEM_PATH you likely are, here's some attempts at answering those questions inline. I'm by no means a shell scripting master and some of this could be utter cobblers, so don't take my word for it – I'd appreciate correction / refinement on any of this points.<br></div><div><br></div><div>Hope this helps in some way.</div><div><br></div><div>Josh</div><div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Mar 9, 2017 at 5:26 PM, Jesse Waites <span dir="ltr"><<a href="mailto:jesse.waites@gmail.com" target="_blank">jesse.waites@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0px 0px 0.357143em;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">Yesterday, because I'm an idiot, I deleted the content of my ~/.zshrc and ~/.bashrc files. Now, I can't start my rails server, console, anything - it says it cant find my gems. Can someone PLEASE answer a few questions. I have been struggling with this for over 12 hours and unable to do the work at my job since my system is down. I have tried putting the paths from 'gem environment' into bashrc</p><p style="margin:0px 0px 0.357143em;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">"<span class="gmail-m_-2566895911587851124gmail-pln" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">export GEM_PATH</span><span class="gmail-m_-2566895911587851124gmail-pun" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span class="gmail-m_-2566895911587851124gmail-str" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">/Library/</span><span class="gmail-m_-2566895911587851124gmail-typ" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Ruby</span><span class="gmail-m_-2566895911587851124gmail-pun" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-m_-2566895911587851124gmail-typ" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">Gems</span><span class="gmail-m_-2566895911587851124gmail-pun" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/</span><span class="gmail-m_-2566895911587851124gmail-lit" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1.<wbr>8</span><span class="gmail-m_-2566895911587851124gmail-pun" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">/:</span><span class="gmail-m_-2566895911587851124gmail-pln" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">$</span><span class="gmail-m_-2566895911587851124gmail-pun" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span class="gmail-m_-2566895911587851124gmail-pln" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">GEM_PATH</span><span class="gmail-m_-2566895911587851124gmail-pun" style="font-family:consolas,menlo,monaco,"lucida console","liberation mono","dejavu sans mono","bitstream vera sans mono","courier new",monospace,sans-serif;white-space:inherit;background-color:rgb(239,240,241);font-size:13px;margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}"</span></p><p style="margin:0px 0px 0.357143em;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">but it doesn't work.</p><p style="margin:0px 0px 0.357143em;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif"><br>1) Why do I even have both ZSH and Bash? Did homebrew install one?<br></p></div></blockquote><div><br></div><div>Bash is the default shell that's installed on your system. If you've got zsh running you'll have installed it – either through Homebrew or some other mechanism.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">2) Why did my terminal (iTerm) seem to switch between zsh and bash depending on what program I'm running?</p></div></blockquote><div><br></div><div>You can have multiple shells installed on a single machine, however the shell that's run when you open a terminal is your "login shell". This is nothing more than the program that your terminal runs when it's launched – that could be bash, or it could be zsh, or it could be any executable. You'll have set this at some point by using the<i> </i><a href="https://en.wikipedia.org/wiki/Chsh">chsh</a> command, which sets your login shell. If you run `finger $USER` you should see a section marked "Shell" which will tell you which login shell you're using – mine looks like "Shell: /usr/local/bin/zsh", as I use zsh.<br></div><div><br></div><div>Your terminal won't switch between shells unless you explicitly tell it to, but some programs might run shell scripts using bash as it's fairly ubiquitous and has a standard syntax (zsh and bash scripts do not have exactly the same syntax, and some people aren't running either as their login shell). If, for example, you install a program by copying and pasting a `curl` command into your terminal, it will likely run as a bash script for compatibility purposes (usually via a <a href="https://en.wikipedia.org/wiki/Shebang_(Unix)">shebang</a>) which will cause "bash" to show up in the title bar of iTerm. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">3) Should I delete bash or zsh and focus on fixing the path to my gems?<br></p></div></blockquote><div><br></div><div>I'd stick to whatever you were using before – you shouldn't need to delete either of them, but either your .bashrc or .zshrc was likely doing something to set up your Ruby environment which it isn't doing any more. Were you using a Ruby version manager like rbenv or RVM?</div><div><br></div><div>Run `which rbenv` and `which rvm` to find out if you were. You'll see a path returned if the command after the "which" was installed.</div><div><br></div><div>If you have rbenv installed, run `rbenv init` and follow the instructions given. I'm less familiar with RVM so can't give useful advice there. If you have both installed, it's probably sensible to remove the one you weren't using.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">4) How do I FIND the path to my gems? I have tried 'gem environment' and pasting the output from there (4 lines? 4 environments?) but it doesnt seem to work. I just want my system to work how it did 2 days ago :(<br></p></div></blockquote><div><br></div><div>This will depend on whether or not you're using a Ruby version manager – see the previous point. </div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">5) How could this have happened to me? Are most devs not stupid enough to delete these files? Im shocked this simple thing has had such devastating consequences. This must be why devs back up their dotfiles on github?</p></div></blockquote><div><br></div><div>As other people have mentioned, a lot of people store their dotfiles on GitHub – it'll save you when this kind of thing happens.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">6) Should I focus on installing rails, gems, etc where it IS looking? I keep getting 'cant build for this or that reason' so thats a nonstarter as well. </p></div></blockquote><div><br></div><div>Again, this is likely because your .zshrc / .bashrc was altering your Ruby environment which isn't happening any more.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">7) Can someone email me a gist of their ~/.zshrc and ~/.bashrc or ~/.bash_profile?</p></div></blockquote><div><br></div><div>For the most part using other people's shell profiles will cause more trouble than it's worth – they'll likely be dependent on software that's not installed on your machine and just result in further confusion. </div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">8) Is there a "stock" one I can use? I can't find an unmodified one on github.</p></div></blockquote><div><br></div><div>If you're using zsh, then <a href="https://github.com/robbyrussell/oh-my-zsh">oh-my-zsh</a> is good for this. There's also a plethora of personal dotfiles at <a href="https://dotfiles.github.io/">https://dotfiles.github.io/</a>, though none of these will work with your machine off the bat – they'll be dependent on software that you likely don't have installed.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p style="margin:0.357143em 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif"><br></p><p style="margin:0.357143em 0px 0px;padding:1px 0px;font-size:14px;line-height:1.3em;font-family:verdana,arial,sans-serif">This whole situation is like, every thread I pull on, something else falls apart. I cannot believe it. Complete disaster. Please help me or kill me and put me out of my misery. I am pulling my hair out here.</p><span class="gmail-HOEnZb"><font color="#888888"><div><br></div>-- <br><div class="gmail-m_-2566895911587851124gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div dir="ltr"><div dir="ltr"><div>Jesse Waites</div><div>Web Developer</div><div><a href="http://JesseWaites.com" target="_blank">JesseWaites.com</a></div></div></div></div></div></div></div></div>
</font></span></div>
<br>______________________________<wbr>_________________<br>
Chat mailing list<br>
<a href="mailto:Chat@lists.lrug.org">Chat@lists.lrug.org</a><br>
Archives: <a href="http://lists.lrug.org/pipermail/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/<wbr>pipermail/chat-lrug.org</a><br>
Manage your subscription: <a href="http://lists.lrug.org/options.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/options.<wbr>cgi/chat-lrug.org</a><br>
List info: <a href="http://lists.lrug.org/listinfo.cgi/chat-lrug.org" rel="noreferrer" target="_blank">http://lists.lrug.org/<wbr>listinfo.cgi/chat-lrug.org</a><br>
<br></blockquote></div><br></div></div></div>