[LRUG] Deleted the contents of ~/.zshrc and ~/.bashrc, system can'tfind rubygems.

jc at panagile.com jc at panagile.com
Fri Mar 10 01:26:07 PST 2017


“Are most devs not stupid enough to delete these files?”

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.

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.

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.


From: Jesse Waites
Sent: 10 March 2017 08:43
To: London Ruby Users Group
Subject: [LRUG] Deleted the contents of ~/.zshrc and ~/.bashrc, system can'tfind rubygems.

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
"export GEM_PATH=/Library/Ruby/Gems/1.8/:${GEM_PATH}"
but it doesn't work.

1) Why do I even have both ZSH and Bash? Did homebrew install one?

2) Why did my terminal (iTerm) seem to switch between zsh and bash depending on what program I'm running?

3) Should I delete bash or zsh and focus on fixing the path to my gems?

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 :(

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?

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. 

7) Can someone email me a gist of their ~/.zshrc and ~/.bashrc or ~/.bash_profile? 

8) Is there a "stock" one I can use? I can't find an unmodified one on github.

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.

-- 
Jesse Waites
Web Developer
JesseWaites.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lrug.org/pipermail/chat-lrug.org/attachments/20170310/a288326e/attachment.html>


More information about the Chat mailing list