<div dir="ltr">This is an annoying problem but usually fairly easily remedied! Like jc said above, it's likely because your rbenv or rvm files are no longer loaded when you start your shell.<div><br></div><div>First thing to do is figure out which shell you actually use. Type this into your terminal:</div><div><br></div><div>$0</div><div><br></div><div>That'll tell you which shell you use. It'll likely return zsh given that you had a zshrc file.</div><div><br></div><div>From here just do what jc said, and reinstall rbenv.. (or rvm, whichever you used); Make sure during the installation (if you're using zsh) that you change the copy paste install paths from bashrc to zshrc, for example:<br><br>Change from:</div><div><i><br></i></div><div><i>echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile</i></div><div><br></div><div>To</div><div><br></div><div><i>echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc</i></div><div><br></div><div>In the install instructions. </div><div><br></div><div>This also answers your other question about why you also had a bashrc! I expect at some point you may have copy paste installed something which created and appended to your bashrc, but then was never used. I'd be very surprised if your system was somehow dynamically switching between shells.</div><div><br></div><div>If you're using zshrc, also consider reinstalling oh-my-zsh. This will restore some of your (probably) lost functionality.</div><div><br></div><div>It's very useful to keep all of your dot files in an git repo, I have one dedicated to tmux, zsh, vimrc etc - any changes I make I immediately push.</div><div><br></div><div>Hope this helps.</div><div><br></div><div>Luke</div></div><div class="gmail_extra"><br><div class="gmail_quote">On 10 March 2017 at 09:26,  <span dir="ltr"><<a href="mailto:jc@panagile.com" target="_blank">jc@panagile.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div lang="EN-GB" link="blue" vlink="#954F72"><div class="m_-2145554766725959280WordSection1"><p class="MsoNormal">“<span style="font-size:10.5pt;font-family:"Verdana",sans-serif">Are most devs not stupid enough to delete these files?”<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">I’m pretty sure that most devs I know have done something similar at some point, even if it’s not specifically deleting those files.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">Are you using rvm/rbenv? They both have some setup that goes into your .bashrc/.zshrc to enable you to pick up the correct version of ruby. Without them you’re probably falling back to the version of ruby that comes with OSX, which doesn’t have any of your gems installed.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">The version of ruby that you want, along with all of the gems, is still there. You just need to get rvm/rbenv working again. Look at the install instructions for them, specifically the bits about adding a line to your .bashrc/.zshrc.<u></u><u></u></span></p><p class="MsoNormal"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p class="MsoNormal"><u></u> <u></u></p><div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0cm 0cm 0cm"><p class="MsoNormal" style="border:none;padding:0cm"><b>From: </b><a href="mailto:jesse.waites@gmail.com" target="_blank">Jesse Waites</a><br><b>Sent: </b>10 March 2017 08:43<br><b>To: </b><a href="mailto:chat@lists.lrug.org" target="_blank">London Ruby Users Group</a><br><b>Subject: </b>[LRUG] Deleted the contents of ~/.zshrc and ~/.bashrc, system can'tfind rubygems.</p></div><div><div class="h5"><p class="MsoNormal"><u></u> <u></u></p><div><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",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<u></u><u></u></span></p><p style="margin:0cm;margin-bottom:.0001pt;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">"</span><span class="m_-2145554766725959280gmail-pln"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">export GEM_PATH</span></span><span class="m_-2145554766725959280gmail-pun"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">=</span></span><span class="m_-2145554766725959280gmail-str"><span style="font-size:10.0pt;font-family:Consolas;color:#7d2727;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">/Library/</span></span><span class="m_-2145554766725959280gmail-typ"><span style="font-size:10.0pt;font-family:Consolas;color:#2b91af;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">Ruby</span></span><span class="m_-2145554766725959280gmail-pun"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">/</span></span><span class="m_-2145554766725959280gmail-typ"><span style="font-size:10.0pt;font-family:Consolas;color:#2b91af;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">Gems</span></span><span class="m_-2145554766725959280gmail-pun"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">/</span></span><span class="m_-2145554766725959280gmail-lit"><span style="font-size:10.0pt;font-family:Consolas;color:#7d2727;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">1.<wbr>8</span></span><span class="m_-2145554766725959280gmail-pun"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">/:</span></span><span class="m_-2145554766725959280gmail-pln"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">$</span></span><span class="m_-2145554766725959280gmail-pun"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">{</span></span><span class="m_-2145554766725959280gmail-pln"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">GEM_PATH</span></span><span class="m_-2145554766725959280gmail-pun"><span style="font-size:10.0pt;font-family:Consolas;color:#303336;border:none windowtext 1.0pt;padding:0cm;background:#eff0f1">}"</span></span><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">but it doesn't work.<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><br>1) Why do I even have both ZSH and Bash? Did homebrew install one?<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">2) Why did my terminal (iTerm) seem to switch between zsh and bash depending on what program I'm running?<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">3) Should I delete bash or zsh and focus on fixing the path to my gems?<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",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 :(<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",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?<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",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. <u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">7) Can someone email me a gist of their ~/.zshrc and ~/.bashrc or ~/.bash_profile? <u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif">8) Is there a "stock" one I can use? I can't find an unmodified one on github.<u></u><u></u></span></p><p style="margin-right:0cm;margin-bottom:4.3pt;margin-left:0cm;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",sans-serif"><u></u> <u></u></span></p><p style="margin-right:0cm;margin-bottom:0cm;margin-left:0cm;margin-bottom:.0001pt;line-height:15.6pt"><span style="font-size:10.5pt;font-family:"Verdana",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.<u></u><u></u></span></p><div><p class="MsoNormal"><u></u> <u></u></p></div><p class="MsoNormal">-- </p><div><div><div><div><div><div><div><div><p class="MsoNormal">Jesse Waites</p></div><div><p class="MsoNormal">Web Developer</p></div></div></div></div></div></div></div></div></div><p class="MsoNormal"><a href="http://JesseWaites.com" target="_blank">JesseWaites.com</a></p><p class="MsoNormal"><u></u> <u></u></p></div></div></div></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>